Home
Gaurav's GitHub Page
Cancel

Max Sum Without Adjacent Elements

Problem Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of the...

Friends Pairing Problem

Problem Description Given N friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends ...

Minimum Number of Squares

Problem Description Given an integer A. Return minimum count of numbers, sum of whose squares is equal to A. Solution public class Solution { public int countMinSquares(int A) { int...

Fibonacci Number

Problem Description Given a positive integer A, write a program to find the Ath Fibonacci number. In a Fibonacci series, each term is the sum of the previous two terms and the first two terms of ...

Stairs

Problem Description You are climbing a staircase and it takes A steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Return the ...

Combination Sum II

Problem Description Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each n...

Subsets II

Problem Description Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution ...

Subsets

Problem Description Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any or...

Combination Sum

Problem Description Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You m...

Permutations

Problem Description Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. leetcode Solution class Solution { List<List&...