All problems

Every problem on the roadmap is in this list. You can search it, or filter by topic, difficulty, or whether a problem is in the 147.

Pattern147 DSA SheetSolve
584Add two large numbersFoundationsData typesEasySolve
585Average of three numbersFoundationsData typesEasySolve
586Grade from marksFoundationsConditionsEasySolve
587Simple calculatorFoundationsConditionsEasySolve
588Fizz BuzzFoundationsLoopsEasySolve
589Multiplication tableFoundationsLoopsEasySolve
590Concatenation of ArrayFoundationsStandard libraryEasySolve
591Count distinct valuesFoundationsStandard libraryEasySolve
592Sort people by age, then nameFoundationsStandard libraryEasySolve
5Square of stars▶FoundationsLoops through pattern printingEasySolve
6Right triangle of stars▶FoundationsLoops through pattern printingEasySolve
7Right triangle of numbers▶FoundationsLoops through pattern printingEasySolve
8Triangle of repeated numbers▶FoundationsLoops through pattern printingEasySolve
9Inverted right triangle of stars▶FoundationsLoops through pattern printingEasySolve
10Inverted right triangle of numbers▶FoundationsLoops through pattern printingEasySolve
11Star pyramid▶FoundationsLoops through pattern printingEasySolve
12Inverted star pyramid▶FoundationsLoops through pattern printingEasySolve
13Star diamond▶FoundationsLoops through pattern printingEasySolve
14Half diamond▶FoundationsLoops through pattern printingEasySolve
15Alternating binary triangle▶FoundationsLoops through pattern printingEasySolve
16Number crown▶FoundationsLoops through pattern printingEasySolve
17Increasing number triangle▶FoundationsLoops through pattern printingEasySolve
18Increasing letter triangle▶FoundationsLoops through pattern printingEasySolve
19Reverse letter triangle▶FoundationsLoops through pattern printingEasySolve
20Letter ramp▶FoundationsLoops through pattern printingEasySolve
21Letter pyramid▶FoundationsLoops through pattern printingEasySolve
22Letter triangle from the end▶FoundationsLoops through pattern printingEasySolve
23Symmetric void▶FoundationsLoops through pattern printingMediumSolve
24Symmetric butterfly▶FoundationsLoops through pattern printingMediumSolve
25Hollow square▶FoundationsLoops through pattern printingMediumSolve
26Concentric number squares▶FoundationsLoops through pattern printingMediumSolve
27Count the digits of a number▶FoundationsWorking with digits and divisorsEasySolve
28Count the odd digits of a number▶FoundationsWorking with digits and divisorsEasySolve
29Largest digit of a number▶FoundationsWorking with digits and divisorsEasySolve
30Palindrome Number▶FoundationsWorking with digits and divisorsEasySolve
31Armstrong Number▶FoundationsWorking with digits and divisorsEasySolve
33All divisors of a number▶FoundationsWorking with digits and divisorsMediumSolve
34Check whether a number is prime▶FoundationsWorking with digits and divisorsMediumSolve
32Perfect Number▶FoundationsWorking with digits and divisorsEasySolve
35GCD of two numbers▶FoundationsWorking with digits and divisorsMediumSolve
36LCM of two numbers▶FoundationsWorking with digits and divisorsMediumSolve
37Print something N times with recursionFoundationsRecursion basicsEasySolve
38Sum of the first N numbersFoundationsRecursion basicsEasySolve
39Factorial of NFoundationsRecursion basicsEasySolve
40Sum of the digits of a numberFoundationsRecursion basicsEasySolve
41Fibonacci NumberFoundationsRecursion basics147 DSA SheetEasySolve
42Count the frequency of each elementFoundationsCounting with arrays and mapsEasySolve
43Most frequent elementFoundationsCounting with arrays and mapsMediumSolve
44Second most frequent elementFoundationsCounting with arrays and mapsMediumSolve
45Sum of the highest and lowest frequencyFoundationsCounting with arrays and mapsMediumSolve
46Linear searchArrays and HashingArray basicsEasySolve
47Largest elementArrays and HashingArray basicsEasySolve
48Second largest elementArrays and HashingArray basicsEasySolve
49Sum of array elementsArrays and HashingArray basicsEasySolve
50Count the odd numbers in an arrayArrays and HashingArray basicsEasySolve
51Reverse an arrayArrays and HashingArray basicsEasySolve
52Check whether an array is sortedArrays and HashingArray basicsEasySolve
53Max Consecutive OnesArrays and HashingArray basicsEasySolve
54Find All Numbers Disappeared in an ArrayArrays and HashingArray basicsEasySolve
55Left rotate an array by oneArrays and HashingArray basicsEasySolve
56Rotate ArrayArrays and HashingArray basicsMediumSolve
57Leaders in an arrayArrays and HashingArray basicsMediumSolve
58Two SumArrays and HashingHash map lookups147 DSA SheetEasySolve
59Contains DuplicateArrays and HashingHash map lookups147 DSA SheetEasySolve
60Valid AnagramArrays and HashingHash map lookups147 DSA SheetEasySolve
61Group AnagramsArrays and HashingHash map lookups147 DSA SheetMediumSolve
62Longest Consecutive SequenceArrays and HashingHash map lookups147 DSA SheetMediumSolve
63Valid SudokuArrays and HashingHash map lookupsMediumSolve
64Encode and Decode StringsArrays and HashingHash map lookupsMediumSolve
65First Unique Character in a StringArrays and HashingHash map lookupsEasySolve
66First Missing PositiveArrays and HashingHash map lookupsHardSolve
67Top K Frequent ElementsArrays and HashingCounting and voting147 DSA SheetMediumSolve
68Majority ElementArrays and HashingCounting and voting147 DSA SheetEasySolve
69Majority Element IIArrays and HashingCounting and votingMediumSolve
94Detect SquaresArrays and HashingCounting and votingMediumSolve
70Best Time to Buy and Sell StockArrays and HashingOne pass with running state147 DSA SheetEasySolve
71Maximum SubarrayArrays and HashingOne pass with running state147 DSA SheetMediumSolve
72Maximum Product SubarrayArrays and HashingOne pass with running state147 DSA SheetMediumSolve
73Product of Array Except SelfArrays and HashingPrefix sums147 DSA SheetMediumSolve
74Subarray Sum Equals KArrays and HashingPrefix sums147 DSA SheetMediumSolve
75Maximum Size Subarray Sum Equals kArrays and HashingPrefix sumsMediumSolve
76Range Sum Query - ImmutableArrays and HashingPrefix sumsEasySolve
77Range Sum Query 2D - ImmutableArrays and HashingPrefix sumsMediumSolve
78Contiguous ArrayArrays and HashingPrefix sumsMediumSolve
79Subarray Sums Divisible by KArrays and HashingPrefix sumsMediumSolve
80Continuous Subarray SumArrays and HashingPrefix sumsMediumSolve
81Longest subarray with sum 0Arrays and HashingPrefix sumsMediumSolve
82Count subarrays with given xor KArrays and HashingPrefix sumsMediumSolve
593Corporate Flight BookingsArrays and HashingDifference arraysMediumSolve
594Car PoolingArrays and HashingDifference arraysMediumSolve
595Shifting Letters IIArrays and HashingDifference arraysMediumSolve
83Spiral MatrixArrays and HashingWalking a matrix147 DSA SheetMediumSolve
84Rotate ImageArrays and HashingWalking a matrixMediumSolve
85Set Matrix ZeroesArrays and HashingWalking a matrixMediumSolve
88Plus OneMathNumber tricks147 DSA SheetEasySolve
89Happy NumberMathNumber tricksEasySolve
90Pow(x, n)MathNumber tricks147 DSA SheetMediumSolve
91Reverse IntegerMathNumber tricksMediumSolve
92Multiply StringsMathNumber tricksMediumSolve
93Count PrimesMathNumber tricksMediumSolve
95Ugly NumberMathNumber tricksEasySolve
96Nim GameMathNumber tricksEasySolve
97Count primes in a rangeMathPrimes and the sieveHardSolve
98Prime factorisationMathPrimes and the sieveMediumSolve
99Count Good NumbersMathFast power and modular arithmeticMediumSolve
100Pascal's TriangleMathPascal's triangle and combinationsEasySolve
101Pascal's Triangle IIMathPascal's triangle and combinationsEasySolve
102Pascal's triangle valueMathPascal's triangle and combinationsMediumSolve
103Check the i-th bitBit ManipulationBit basicsEasySolve
104Odd or even with bitsBit ManipulationBit basicsEasySolve
105Power of TwoBit ManipulationBit basicsEasySolve
106Set the lowest zero bitBit ManipulationBit basicsEasySolve
107Swap without a tempBit ManipulationBit basicsEasySolve
108Hamming DistanceBit ManipulationBit basicsEasySolve
109Minimum Bit Flips to Convert NumberBit ManipulationBit basicsEasySolve
110Single NumberBit ManipulationXOR tricks147 DSA SheetEasySolve
111Missing NumberBit ManipulationXOR tricks147 DSA SheetEasySolve
112Single Number IIBit ManipulationXOR tricksMediumSolve
113Single Number IIIBit ManipulationXOR tricksMediumSolve
114Set MismatchBit ManipulationXOR tricksEasySolve
115XOR of all numbers in a rangeBit ManipulationXOR tricksMediumSolve
116Number of 1 BitsBit ManipulationCounting and shifting bits147 DSA SheetEasySolve
117Counting BitsBit ManipulationCounting and shifting bits147 DSA SheetEasySolve
118Reverse BitsBit ManipulationCounting and shifting bits147 DSA SheetEasySolve
119Sum of Two IntegersBit ManipulationCounting and shifting bitsMediumSolve
120Divide Two IntegersBit ManipulationCounting and shifting bitsMediumSolve
121Bitwise AND of Numbers RangeBit ManipulationCounting and shifting bitsMediumSolve
122Subsets in binary orderBit ManipulationBitmasksMediumSolve
123Reverse StringStringsString basicsEasySolve
124Valid Palindrome IIStringsString basicsEasySolve
125Largest Odd Number in StringStringsString basicsEasySolve
126Longest Common PrefixStringsString basics147 DSA SheetEasySolve
127Isomorphic StringsStringsString basicsEasySolve
128Rotate StringStringsString basicsEasySolve
129Longest PalindromeStringsString basicsEasySolve
130Reverse Words in a StringStringsString basicsMediumSolve
131String CompressionStringsString basicsMediumSolve
132Count and SayStringsString basicsMediumSolve
133Remove Outermost ParenthesesStringsParentheses and nestingEasySolve
134Maximum Nesting Depth of the ParenthesesStringsParentheses and nestingEasySolve
135Minimum Add to Make Parentheses ValidStringsParentheses and nestingMediumSolve
136Fewest bracket flipsStringsParentheses and nestingMediumSolve
137Roman to IntegerStringsParsing and conversionEasySolve
138String to Integer (atoi)StringsParsing and conversionMediumSolve
139Implement atoi with recursionStringsParsing and conversionMediumSolve
140Sort Characters By FrequencyStringsCounting over substringsMediumSolve
141Sum of Beauty of All SubstringsStringsCounting over substringsMediumSolve
142Count substrings with exactly K distinct charactersStringsCounting over substringsMediumSolve
143Selection sortSortingSimple sortsMediumSolve
144Bubble sortSortingSimple sortsMediumSolve
145Insertion sortSortingSimple sortsMediumSolve
146Bubble sort with recursionSortingSimple sortsMediumSolve
147Insertion sort with recursionSortingSimple sortsMediumSolve
148Merge sortSortingDivide-and-conquer sortsMediumSolve
149Quick sortSortingDivide-and-conquer sortsMediumSolve
150Sort an ArraySortingDivide-and-conquer sorts147 DSA SheetMediumSolve
151Largest NumberSortingDivide-and-conquer sortsMediumSolve
86Reverse PairsSortingCounting during merge sortHardSolve
87Count InversionsSortingCounting during merge sortMediumSolve
152Valid PalindromeTwo PointersPointers from both ends147 DSA SheetEasySolve
153Two Sum II - Input Array Is SortedTwo PointersPointers from both ends147 DSA SheetMediumSolve
1543SumTwo PointersPointers from both ends147 DSA SheetMediumSolve
155Container With Most WaterTwo PointersPointers from both ends147 DSA SheetMediumSolve
1564SumTwo PointersPointers from both endsMediumSolve
157Trapping Rain WaterTwo PointersPointers from both ends147 DSA SheetHardSolve
158Squares of a Sorted ArrayTwo PointersPointers from both endsEasySolve
1593Sum ClosestTwo PointersPointers from both endsMediumSolve
160Boats to Save PeopleTwo PointersPointers from both endsMediumSolve
161Sort ColorsTwo PointersRearranging in place147 DSA SheetMediumSolve
162Next PermutationTwo PointersRearranging in place147 DSA SheetMediumSolve
163Move ZeroesTwo PointersRearranging in placeEasySolve
164Remove Duplicates from Sorted ArrayTwo PointersRearranging in placeEasySolve
165Rearrange Array Elements by SignTwo PointersRearranging in placeMediumSolve
166Union of two sorted arraysTwo PointersMerging sorted arraysMediumSolve
167Intersection of two sorted arraysTwo PointersMerging sorted arraysMediumSolve
168Merge Sorted ArrayTwo PointersMerging sorted arraysEasySolve
169Merge two sorted arrays without extra spaceTwo PointersMerging sorted arraysHardSolve
170Longest Substring Without Repeating CharactersSliding WindowLongest or shortest window147 DSA SheetMediumSolve
171Max Consecutive Ones IIISliding WindowLongest or shortest window147 DSA SheetMediumSolve
172Longest Repeating Character ReplacementSliding WindowLongest or shortest window147 DSA SheetMediumSolve
173Longest Substring with At Most K Distinct CharactersSliding WindowLongest or shortest windowMediumSolve
174Minimum Window SubstringSliding WindowLongest or shortest window147 DSA SheetHardSolve
175Minimum Size Subarray SumSliding WindowLongest or shortest windowMediumSolve
176Fruit Into BasketsSliding WindowLongest or shortest windowMediumSolve
177Minimum Window SubsequenceSliding WindowLongest or shortest windowHardSolve
178Permutation in StringSliding WindowFixed-size window147 DSA SheetMediumSolve
179Maximum Points You Can Obtain from CardsSliding WindowFixed-size window147 DSA SheetMediumSolve
180Maximum Average Subarray ISliding WindowFixed-size windowEasySolve
181Find All Anagrams in a StringSliding WindowFixed-size windowMediumSolve
182Binary Subarrays With SumSliding WindowCounting windows147 DSA SheetMediumSolve
183Count Number of Nice SubarraysSliding WindowCounting windowsMediumSolve
184Number of Substrings Containing All Three CharactersSliding WindowCounting windowsMediumSolve
185Subarrays with K Different IntegersSliding WindowCounting windowsHardSolve
225Lower boundBinary SearchLower and upper boundsMediumSolve
226Upper boundBinary SearchLower and upper boundsMediumSolve
227Search Insert PositionBinary SearchLower and upper boundsEasySolve
228Floor and ceil in a sorted arrayBinary SearchLower and upper boundsMediumSolve
229Find First and Last Position of Element in Sorted ArrayBinary SearchLower and upper boundsMediumSolve
230Count occurrences in a sorted arrayBinary SearchLower and upper boundsMediumSolve
231How many times is a sorted array rotatedBinary SearchLower and upper boundsMediumSolve
232Peak Index in a Mountain ArrayBinary SearchLower and upper boundsMediumSolve
233Binary SearchBinary SearchSearching a sorted array147 DSA SheetEasySolve
234Search in Rotated Sorted ArrayBinary SearchSearching a sorted array147 DSA SheetMediumSolve
235Find Minimum in Rotated Sorted ArrayBinary SearchSearching a sorted array147 DSA SheetMediumSolve
236Search in Rotated Sorted Array IIBinary SearchSearching a sorted arrayMediumSolve
237Single Element in a Sorted ArrayBinary SearchSearching a sorted arrayMediumSolve
238Find Peak ElementBinary SearchSearching a sorted array147 DSA SheetMediumSolve
239Time Based Key-Value StoreBinary SearchSearching a sorted arrayMediumSolve
240Sqrt(x)Binary SearchSearching the answer147 DSA SheetEasySolve
241Koko Eating BananasBinary SearchSearching the answer147 DSA SheetMediumSolve
242Magnetic Force Between Two BallsBinary SearchSearching the answer147 DSA SheetMediumSolve
243Split Array Largest SumBinary SearchSearching the answer147 DSA SheetHardSolve
244Nth root of a numberBinary SearchSearching the answerMediumSolve
245Find the Smallest Divisor Given a ThresholdBinary SearchSearching the answerMediumSolve
246Minimum Number of Days to Make m BouquetsBinary SearchSearching the answerMediumSolve
247Capacity To Ship Packages Within D DaysBinary SearchSearching the answerMediumSolve
248Kth Missing Positive NumberBinary SearchSearching the answerEasySolve
249Aggressive cowsBinary SearchSearching the answerHardSolve
250Book allocationBinary SearchSearching the answerHardSolve
251Painter's partitionBinary SearchSearching the answerHardSolve
252Minimize Max Distance to Gas StationBinary SearchSearching the answerHardSolve
253Search a 2D MatrixBinary SearchSearching a matrixMediumSolve
254Search a 2D Matrix IIBinary SearchSearching a matrixMediumSolve
255Kth Smallest Element in a Sorted MatrixBinary SearchSearching a matrixMediumSolve
256Row with the most 1sBinary SearchSearching a matrixMediumSolve
257Find a Peak Element IIBinary SearchSearching a matrixMediumSolve
258Median of a Row Wise Sorted MatrixBinary SearchSearching a matrixMediumSolve
259Median of Two Sorted ArraysBinary SearchPartition search147 DSA SheetHardSolve
260K-th element of two sorted arraysBinary SearchPartition searchHardSolve
261Traverse a linked listLinked ListsSingly linked list basicsEasySolve
262Length of a linked listLinked ListsSingly linked list basicsEasySolve
263Search in a linked listLinked ListsSingly linked list basicsEasySolve
264Insert at the headLinked ListsSingly linked list basicsMediumSolve
265Insert at the tailLinked ListsSingly linked list basicsMediumSolve
266Insert at position KLinked ListsSingly linked list basicsMediumSolve
267Insert before the value XLinked ListsSingly linked list basicsMediumSolve
268Delete the headLinked ListsSingly linked list basicsMediumSolve
269Delete the tailLinked ListsSingly linked list basicsMediumSolve
270Delete the K-th nodeLinked ListsSingly linked list basicsMediumSolve
271Delete the node with value XLinked ListsSingly linked list basicsMediumSolve
272Delete Node in a Linked ListLinked ListsSingly linked list basicsMediumSolve
273Remove Linked List ElementsLinked ListsSingly linked list basicsEasySolve
274Design Linked ListLinked ListsSingly linked list basicsMediumSolve
275Build a doubly linked list from an arrayLinked ListsDoubly linked listsMediumSolve
276Insert before the headLinked ListsDoubly linked listsMediumSolve
277Insert before the tailLinked ListsDoubly linked listsMediumSolve
278Insert before the K-th nodeLinked ListsDoubly linked listsMediumSolve
279Insert before a given nodeLinked ListsDoubly linked listsMediumSolve
280Delete the headLinked ListsDoubly linked listsMediumSolve
281Delete the tailLinked ListsDoubly linked listsMediumSolve
282Delete the K-th nodeLinked ListsDoubly linked listsMediumSolve
283Delete a given nodeLinked ListsDoubly linked listsMediumSolve
284Reverse a doubly linked listLinked ListsDoubly linked listsMediumSolve
285Delete every occurrence of a keyLinked ListsDoubly linked listsMediumSolve
286Remove duplicates from a sorted doubly linked listLinked ListsDoubly linked listsMediumSolve
287Pairs with a given sum in a doubly linked listLinked ListsDoubly linked listsMediumSolve
288Middle of the Linked ListLinked ListsFast and slow pointers147 DSA SheetEasySolve
289Linked List CycleLinked ListsFast and slow pointers147 DSA SheetEasySolve
290Remove Nth Node From End of ListLinked ListsFast and slow pointers147 DSA SheetMediumSolve
291Palindrome Linked ListLinked ListsFast and slow pointersEasySolve
292Intersection of Two Linked ListsLinked ListsFast and slow pointersEasySolve
293Linked List Cycle IILinked ListsFast and slow pointers147 DSA SheetMediumSolve
294Find the Duplicate NumberLinked ListsFast and slow pointersMediumSolve
295Delete the Middle Node of a Linked ListLinked ListsFast and slow pointersMediumSolve
296Length of the loop in a linked listLinked ListsFast and slow pointersEasySolve
297Reverse Linked ListLinked ListsReversing and rewiring147 DSA SheetEasySolve
298Merge Two Sorted ListsLinked ListsReversing and rewiring147 DSA SheetEasySolve
299Reorder ListLinked ListsReversing and rewiring147 DSA SheetMediumSolve
300Add Two NumbersLinked ListsReversing and rewiring147 DSA SheetMediumSolve
301Rotate ListLinked ListsReversing and rewiringMediumSolve
302Sort ListLinked ListsReversing and rewiringMediumSolve
303Copy List with Random PointerLinked ListsReversing and rewiring147 DSA SheetMediumSolve
304Reverse Nodes in k-GroupLinked ListsReversing and rewiring147 DSA SheetHardSolve
305Odd Even Linked ListLinked ListsReversing and rewiringMediumSolve
306Reverse Linked List IILinked ListsReversing and rewiringMediumSolve
307Plus One Linked ListLinked ListsReversing and rewiringMediumSolve
308Next Greater Node In Linked ListLinked ListsReversing and rewiringMediumSolve
309Sort a linked list of 0s, 1s and 2sLinked ListsReversing and rewiringMediumSolve
310Flatten a linked listLinked ListsReversing and rewiringHardSolve
311LRU CacheLinked ListsA list and a map together147 DSA SheetMediumSolve
312LFU CacheLinked ListsA list and a map togetherHardSolve
186Implement a stack with an arrayStacks and QueuesBuilding stacks and queuesMediumSolve
187Implement a queue with an arrayStacks and QueuesBuilding stacks and queuesMediumSolve
188Implement a stack with a linked listStacks and QueuesBuilding stacks and queuesMediumSolve
189Implement a queue with a linked listStacks and QueuesBuilding stacks and queuesMediumSolve
190Implement Stack using QueuesStacks and QueuesBuilding stacks and queuesEasySolve
191Implement Queue using StacksStacks and QueuesBuilding stacks and queuesEasySolve
192Design Circular QueueStacks and QueuesBuilding stacks and queuesMediumSolve
193Design Circular DequeStacks and QueuesBuilding stacks and queuesMediumSolve
194Valid ParenthesesStacks and QueuesMatching and cancelling147 DSA SheetEasySolve
195Min StackStacks and QueuesMatching and cancelling147 DSA SheetMediumSolve
196Evaluate Reverse Polish NotationStacks and QueuesMatching and cancelling147 DSA SheetMediumSolve
197Asteroid CollisionStacks and QueuesMatching and cancellingMediumSolve
198Find the CelebrityStacks and QueuesMatching and cancellingMediumSolve
199Baseball GameStacks and QueuesMatching and cancellingEasySolve
200Backspace String CompareStacks and QueuesMatching and cancellingEasySolve
201Simplify PathStacks and QueuesMatching and cancellingMediumSolve
202Decode StringStacks and QueuesMatching and cancellingMediumSolve
203Basic Calculator IIStacks and QueuesMatching and cancellingMediumSolve
204Infix to postfixStacks and QueuesInfix, prefix and postfixMediumSolve
205Infix to prefixStacks and QueuesInfix, prefix and postfixMediumSolve
206Postfix to infixStacks and QueuesInfix, prefix and postfixMediumSolve
207Prefix to infixStacks and QueuesInfix, prefix and postfixMediumSolve
208Prefix to postfixStacks and QueuesInfix, prefix and postfixMediumSolve
209Postfix to prefixStacks and QueuesInfix, prefix and postfixMediumSolve
210Next Greater Element IStacks and QueuesMonotonic stack147 DSA SheetEasySolve
211Daily TemperaturesStacks and QueuesMonotonic stack147 DSA SheetMediumSolve
212Next Greater Element IIStacks and QueuesMonotonic stackMediumSolve
213Online Stock SpanStacks and QueuesMonotonic stackMediumSolve
214Car FleetStacks and QueuesMonotonic stack147 DSA SheetMediumSolve
215Remove K DigitsStacks and QueuesMonotonic stackMediumSolve
216Sum of Subarray MinimumsStacks and QueuesMonotonic stackMediumSolve
217Sum of Subarray RangesStacks and QueuesMonotonic stackMediumSolve
218Largest Rectangle in HistogramStacks and QueuesMonotonic stack147 DSA SheetHardSolve
219Maximal RectangleStacks and QueuesMonotonic stackHardSolve
220Next smaller elementStacks and QueuesMonotonic stackMediumSolve
221Number of greater elements to the rightStacks and QueuesMonotonic stackMediumSolve
222132 PatternStacks and QueuesMonotonic stackMediumSolve
223Sliding Window MaximumStacks and QueuesMonotonic queue147 DSA SheetHardSolve
224Sliding Window MedianStacks and QueuesMonotonic queueHardSolve
313Does a subsequence with sum K existRecursion and BacktrackingPick or skipMediumSolve
314Count subsequences with sum KRecursion and BacktrackingPick or skipMediumSolve
315Binary strings without consecutive 1sRecursion and BacktrackingPick or skipMediumSolve
316Reverse a stack with recursionRecursion and BacktrackingRecursion on a stackMediumSolve
317Sort a stack with recursionRecursion and BacktrackingRecursion on a stackMediumSolve
318SubsetsRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
319PermutationsRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
320Subsets IIRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
321Combination SumRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
322Combination Sum IIRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
323Letter Combinations of a Phone NumberRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
324Generate ParenthesesRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
325Palindrome PartitioningRecursion and BacktrackingGenerating every choice147 DSA SheetMediumSolve
326CombinationsRecursion and BacktrackingGenerating every choiceMediumSolve
327Permutations IIRecursion and BacktrackingGenerating every choiceMediumSolve
328Combination Sum IIIRecursion and BacktrackingGenerating every choiceMediumSolve
329Gray CodeRecursion and BacktrackingGenerating every choiceMediumSolve
330Word SearchRecursion and BacktrackingSearching with constraints147 DSA SheetMediumSolve
331N-QueensRecursion and BacktrackingSearching with constraints147 DSA SheetHardSolve
332Sudoku SolverRecursion and BacktrackingSearching with constraintsHardSolve
333Rat in a mazeRecursion and BacktrackingSearching with constraintsHardSolve
334M-coloringRecursion and BacktrackingSearching with constraintsHardSolve
335Beautiful ArrangementRecursion and BacktrackingSearching with constraintsMediumSolve
336Word Break IIRecursion and BacktrackingSearching with constraintsHardSolve
337Expression Add OperatorsRecursion and BacktrackingSearching with constraintsHardSolve
338Binary Tree Preorder TraversalBinary TreesTraversalsEasySolve
339Binary Tree Inorder TraversalBinary TreesTraversalsEasySolve
340Binary Tree Postorder TraversalBinary TreesTraversalsEasySolve
342Morris inorder traversalBinary TreesTraversalsHardSolve
343Morris preorder traversalBinary TreesTraversalsHardSolve
344Maximum Depth of Binary TreeBinary TreesDepth first: return a value up147 DSA SheetEasySolve
345Invert Binary TreeBinary TreesDepth first: return a value up147 DSA SheetEasySolve
346Same TreeBinary TreesDepth first: return a value up147 DSA SheetEasySolve
347Subtree of Another TreeBinary TreesDepth first: return a value up147 DSA SheetEasySolve
348Balanced Binary TreeBinary TreesDepth first: return a value upEasySolve
349Diameter of Binary TreeBinary TreesDepth first: return a value up147 DSA SheetEasySolve
350Count Good Nodes in Binary TreeBinary TreesDepth first: return a value upMediumSolve
351Binary Tree PathsBinary TreesDepth first: return a value upEasySolve
352Lowest Common Ancestor of a Binary TreeBinary TreesDepth first: return a value up147 DSA SheetMediumSolve
353Binary Tree Maximum Path SumBinary TreesDepth first: return a value up147 DSA SheetHardSolve
354Boundary of Binary TreeBinary TreesDepth first: return a value upMediumSolve
355Minimum Depth of Binary TreeBinary TreesDepth first: return a value upEasySolve
356Symmetric TreeBinary TreesDepth first: return a value upEasySolve
357Merge Two Binary TreesBinary TreesDepth first: return a value upEasySolve
358Path SumBinary TreesDepth first: return a value upEasySolve
359Path Sum IIBinary TreesDepth first: return a value upMediumSolve
360Sum Root to Leaf NumbersBinary TreesDepth first: return a value upMediumSolve
361Path Sum IIIBinary TreesDepth first: return a value upMediumSolve
362Children sum propertyBinary TreesDepth first: return a value upMediumSolve
363Path from the root to a nodeBinary TreesDepth first: return a value upMediumSolve
364Count Complete Tree NodesBinary TreesDepth first: return a value upMediumSolve
365Flatten Binary Tree to Linked ListBinary TreesDepth first: return a value upMediumSolve
366House Robber IIIBinary TreesDepth first: return a value upMediumSolve
367Binary Tree Level Order TraversalBinary TreesBreadth first: level by level147 DSA SheetMediumSolve
368Binary Tree Right Side ViewBinary TreesBreadth first: level by level147 DSA SheetMediumSolve
369Maximum Width of Binary TreeBinary TreesBreadth first: level by levelMediumSolve
370All Nodes Distance K in Binary TreeBinary TreesBreadth first: level by level147 DSA SheetMediumSolve
371Amount of Time for Binary Tree to Be InfectedBinary TreesBreadth first: level by levelMediumSolve
372Vertical Order Traversal of a Binary TreeBinary TreesBreadth first: level by levelHardSolve
373Binary Tree Zigzag Level Order TraversalBinary TreesBreadth first: level by levelMediumSolve
374Binary Tree Level Order Traversal IIBinary TreesBreadth first: level by levelMediumSolve
375Average of Levels in Binary TreeBinary TreesBreadth first: level by levelEasySolve
376Populating Next Right Pointers in Each NodeBinary TreesBreadth first: level by levelMediumSolve
377Top view of a binary treeBinary TreesBreadth first: level by levelMediumSolve
378Bottom view of a binary treeBinary TreesBreadth first: level by levelMediumSolve
379Construct Binary Tree from Preorder and Inorder TraversalBinary TreesBuilding and serializing147 DSA SheetMediumSolve
380Serialize and Deserialize Binary TreeBinary TreesBuilding and serializing147 DSA SheetHardSolve
381Construct Binary Tree from Inorder and Postorder TraversalBinary TreesBuilding and serializingMediumSolve
382Search in a Binary Search TreeBinary Search TreesBST basicsEasySolve
383Minimum and maximum in a BSTBinary Search TreesBST basicsEasySolve
384Floor and ceil in a BSTBinary Search TreesBST basicsMediumSolve
385Range Sum of BSTBinary Search TreesBST basicsEasySolve
386Convert Sorted Array to Binary Search TreeBinary Search TreesBST basicsEasySolve
387Validate Binary Search TreeBinary Search TreesUsing the ordering147 DSA SheetMediumSolve
388Kth Smallest Element in a BSTBinary Search TreesUsing the ordering147 DSA SheetMediumSolve
389Lowest Common Ancestor of a Binary Search TreeBinary Search TreesUsing the ordering147 DSA SheetMediumSolve
390Insert into a Binary Search TreeBinary Search TreesUsing the orderingMediumSolve
391Delete Node in a BSTBinary Search TreesUsing the ordering147 DSA SheetMediumSolve
392Construct Binary Search Tree from Preorder TraversalBinary Search TreesUsing the orderingMediumSolve
393Two Sum IV - Input is a BSTBinary Search TreesUsing the orderingEasySolve
394Recover Binary Search TreeBinary Search TreesUsing the ordering147 DSA SheetMediumSolve
395Largest BST SubtreeBinary Search TreesUsing the orderingMediumSolve
396Trim a Binary Search TreeBinary Search TreesUsing the orderingMediumSolve
397Inorder Successor in BSTBinary Search TreesUsing the orderingMediumSolve
398Binary Search Tree IteratorBinary Search TreesUsing the orderingMediumSolve
399Maximum Sum BST in Binary TreeBinary Search TreesUsing the orderingHardSolve
400Implement Min HeapHeapsBuilding a heapMediumSolve
401Implement a max heapHeapsBuilding a heapMediumSolve
402Build a heap from an arrayHeapsBuilding a heapEasySolve
403Does an array represent a min heapHeapsBuilding a heapMediumSolve
404Convert a min heap to a max heapHeapsBuilding a heapMediumSolve
405Heap sortHeapsBuilding a heapHardSolve
406Kth Largest Element in a StreamHeapsTop K147 DSA SheetEasySolve
407Kth Largest Element in an ArrayHeapsTop K147 DSA SheetMediumSolve
408K Closest Points to OriginHeapsTop K147 DSA SheetMediumSolve
410Find K Closest ElementsHeapsTop KMediumSolve
414Last Stone WeightHeapsSimulating with a heap147 DSA SheetEasySolve
415Task SchedulerHeapsSimulating with a heap147 DSA SheetMediumSolve
416Design TwitterHeapsSimulating with a heapMediumSolve
417Connect ropes at minimum costHeapsSimulating with a heapEasySolve
418Reorganize StringHeapsSimulating with a heapMediumSolve
419IPOHeapsSimulating with a heapHardSolve
420Find Median from Data StreamHeapsTwo heaps147 DSA SheetHardSolve
421Merge k Sorted ListsHeapsMerging k sorted lists147 DSA SheetHardSolve
422Implement Trie (Prefix Tree)TriesPrefix trees147 DSA SheetMediumSolve
423Design Add and Search Words Data StructureTriesPrefix trees147 DSA SheetMediumSolve
424Longest Word in DictionaryTriesPrefix treesMediumSolve
425Implement Trie II (Prefix Tree)TriesPrefix treesMediumSolve
426Word Search IITriesPrefix trees147 DSA SheetHardSolve
428Longest Word With All PrefixesTriesPrefix treesMediumSolve
429Maximum XOR of Two Numbers in an ArrayTriesTries over bitsMediumSolve
491Jump GameGreedyThe best choice now147 DSA SheetMediumSolve
492Jump Game IIGreedyThe best choice now147 DSA SheetMediumSolve
493Gas StationGreedyThe best choice now147 DSA SheetMediumSolve
494Partition LabelsGreedyThe best choice now147 DSA SheetMediumSolve
495Hand of StraightsGreedyThe best choice nowMediumSolve
496Merge Triplets to Form Target TripletGreedyThe best choice nowMediumSolve
497Valid Parenthesis StringGreedyThe best choice now147 DSA SheetMediumSolve
498CandyGreedyThe best choice now147 DSA SheetHardSolve
499Assign CookiesGreedyThe best choice nowEasySolve
500Lemonade ChangeGreedyThe best choice nowEasySolve
501Fractional knapsackGreedyThe best choice nowMediumSolve
502Fewest coins with greedyGreedyThe best choice nowEasySolve
503Shortest job firstGreedyThe best choice nowMediumSolve
504Job sequencingGreedyThe best choice nowMediumSolve
505Minimum Number of Arrows to Burst BalloonsGreedyThe best choice nowMediumSolve
506Merge IntervalsIntervalsMerging and scheduling147 DSA SheetMediumSolve
507Insert IntervalIntervalsMerging and scheduling147 DSA SheetMediumSolve
508Non-overlapping IntervalsIntervalsMerging and scheduling147 DSA SheetMediumSolve
509Meeting RoomsIntervalsMerging and schedulingEasySolve
510Meeting Rooms IIIntervalsMerging and schedulingMediumSolve
511Minimum Interval to Include Each QueryIntervalsMerging and scheduling147 DSA SheetHardSolve
512Most meetings in one roomIntervalsMerging and schedulingEasySolve
513Minimum platformsIntervalsMerging and schedulingMediumSolve
431BFS and DFS of a graphGraphsGraph basicsEasySolve
432Keys and RoomsGraphsGraph basicsMediumSolve
433All Paths From Source to TargetGraphsGraph basicsMediumSolve
434Flood FillGraphsGrids as graphs147 DSA SheetEasySolve
435Number of IslandsGraphsGrids as graphs147 DSA SheetMediumSolve
436Max Area of IslandGraphsGrids as graphsMediumSolve
437Surrounded RegionsGraphsGrids as graphs147 DSA SheetMediumSolve
438Pacific Atlantic Water FlowGraphsGrids as graphs147 DSA SheetMediumSolve
439Number of Distinct IslandsGraphsGrids as graphsMediumSolve
440Number of EnclavesGraphsGrids as graphsMediumSolve
441Number of Closed IslandsGraphsGrids as graphsMediumSolve
442Rotting OrangesGraphsFewest steps with BFS147 DSA SheetMediumSolve
44301 MatrixGraphsFewest steps with BFS147 DSA SheetMediumSolve
444Walls and GatesGraphsFewest steps with BFSMediumSolve
445Shortest Path in Binary MatrixGraphsFewest steps with BFSMediumSolve
446Word LadderGraphsFewest steps with BFS147 DSA SheetHardSolve
447Shortest path with unit weightsGraphsFewest steps with BFSMediumSolve
448Clone GraphGraphsTraversing a graph147 DSA SheetMediumSolve
449Is Graph Bipartite?GraphsTraversing a graphMediumSolve
451Graph Valid TreeGraphsTraversing a graphMediumSolve
452Number of ProvincesGraphsTraversing a graphMediumSolve
453Cycle in an undirected graphGraphsCycle detectionMediumSolve
454Cycle in a directed graphGraphsCycle detectionMediumSolve
455Course ScheduleGraphsTopological sort147 DSA SheetMediumSolve
456Course Schedule IIGraphsTopological sort147 DSA SheetMediumSolve
457Alien DictionaryGraphsTopological sortHardSolve
458Topological sort (Kahn's algorithm)GraphsTopological sortMediumSolve
459Find Eventual Safe StatesGraphsTopological sortMediumSolve
460Course Schedule IVGraphsTopological sortMediumSolve
461Minimum Height TreesGraphsTopological sortMediumSolve
462Redundant ConnectionGraphsUnion-find147 DSA SheetMediumSolve
464Making A Large IslandGraphsUnion-findHardSolve
465Number of Islands IIGraphsUnion-findHardSolve
466Disjoint set unionGraphsUnion-findMediumSolve
467Accounts MergeGraphsUnion-findMediumSolve
470Redundant Connection IIGraphsUnion-findHardSolve
471Network Delay TimeAdvanced GraphsWeighted shortest paths147 DSA SheetMediumSolve
472Path With Minimum EffortAdvanced GraphsWeighted shortest paths147 DSA SheetMediumSolve
473Cheapest Flights Within K StopsAdvanced GraphsWeighted shortest paths147 DSA SheetMediumSolve
474Swim in Rising WaterAdvanced GraphsWeighted shortest paths147 DSA SheetHardSolve
476Word Ladder IIAdvanced GraphsWeighted shortest pathsHardSolve
477Shortest path in a DAGAdvanced GraphsWeighted shortest pathsMediumSolve
478Dijkstra's algorithmAdvanced GraphsWeighted shortest pathsMediumSolve
479Print the shortest pathAdvanced GraphsWeighted shortest pathsMediumSolve
480Number of Ways to Arrive at DestinationAdvanced GraphsWeighted shortest pathsMediumSolve
481Path with Maximum ProbabilityAdvanced GraphsWeighted shortest pathsMediumSolve
482Minimum multiplications to reach the endAdvanced GraphsWeighted shortest pathsHardSolve
483Bellman-Ford algorithmAdvanced GraphsWeighted shortest pathsMediumSolve
484Floyd-Warshall algorithmAdvanced GraphsWeighted shortest pathsHardSolve
485Min Cost to Connect All PointsAdvanced GraphsMinimum spanning trees147 DSA SheetMediumSolve
486Minimum spanning tree weightAdvanced GraphsMinimum spanning treesMediumSolve
487Reconstruct ItineraryAdvanced GraphsSpecial edges and pathsHardSolve
488Critical Connections in a NetworkAdvanced GraphsSpecial edges and pathsHardSolve
489Strongly connected components (Kosaraju)Advanced GraphsSpecial edges and pathsHardSolve
490Articulation pointsAdvanced GraphsSpecial edges and pathsHardSolve
514Climbing Stairs1-D Dynamic ProgrammingTake it or skip it147 DSA SheetEasySolve
515Min Cost Climbing Stairs1-D Dynamic ProgrammingTake it or skip itEasySolve
516House Robber1-D Dynamic ProgrammingTake it or skip it147 DSA SheetMediumSolve
517House Robber II1-D Dynamic ProgrammingTake it or skip it147 DSA SheetMediumSolve
518Decode Ways1-D Dynamic ProgrammingTake it or skip it147 DSA SheetMediumSolve
519Word Break1-D Dynamic ProgrammingTake it or skip it147 DSA SheetMediumSolve
520N-th Tribonacci Number1-D Dynamic ProgrammingTake it or skip itEasySolve
521Frog jump with K steps1-D Dynamic ProgrammingTake it or skip itEasySolve
522Perfect Squares1-D Dynamic ProgrammingTake it or skip itMediumSolve
523Minimum Cost For Tickets1-D Dynamic ProgrammingTake it or skip itMediumSolve
524Training schedule with no repeated activity1-D Dynamic ProgrammingTake it or skip itMediumSolve
525Longest Palindromic Substring1-D Dynamic ProgrammingPalindromes147 DSA SheetMediumSolve
526Palindromic Substrings1-D Dynamic ProgrammingPalindromes147 DSA SheetMediumSolve
527Longest Increasing Subsequence1-D Dynamic ProgrammingIncreasing subsequences147 DSA SheetMediumSolve
528Number of Longest Increasing Subsequence1-D Dynamic ProgrammingIncreasing subsequencesMediumSolve
529Print a longest increasing subsequence1-D Dynamic ProgrammingIncreasing subsequencesHardSolve
530Largest Divisible Subset1-D Dynamic ProgrammingIncreasing subsequencesMediumSolve
531Longest String Chain1-D Dynamic ProgrammingIncreasing subsequencesMediumSolve
532Longest bitonic subsequence1-D Dynamic ProgrammingIncreasing subsequencesMediumSolve
533Best Time to Buy and Sell Stock with Cooldown1-D Dynamic ProgrammingBuying and selling with states147 DSA SheetMediumSolve
534Best Time to Buy and Sell Stock with Transaction Fee1-D Dynamic ProgrammingBuying and selling with statesMediumSolve
535Best Time to Buy and Sell Stock IV1-D Dynamic ProgrammingBuying and selling with statesHardSolve
536Best Time to Buy and Sell Stock II1-D Dynamic ProgrammingBuying and selling with statesMediumSolve
537Best Time to Buy and Sell Stock III1-D Dynamic ProgrammingBuying and selling with statesHardSolve
538Unique Paths2-D Dynamic ProgrammingPaths in a grid147 DSA SheetMediumSolve
539Unique Paths II2-D Dynamic ProgrammingPaths in a gridMediumSolve
540Longest Increasing Path in a Matrix2-D Dynamic ProgrammingPaths in a grid147 DSA SheetHardSolve
541Minimum Path Sum2-D Dynamic ProgrammingPaths in a gridMediumSolve
542Triangle2-D Dynamic ProgrammingPaths in a gridMediumSolve
543Minimum Falling Path Sum2-D Dynamic ProgrammingPaths in a gridMediumSolve
544Count Square Submatrices with All Ones2-D Dynamic ProgrammingPaths in a gridMediumSolve
545Cherry Pickup II2-D Dynamic ProgrammingPaths in a gridHardSolve
5460/1 knapsack2-D Dynamic ProgrammingKnapsackMediumSolve
547Partition Equal Subset Sum2-D Dynamic ProgrammingKnapsack147 DSA SheetMediumSolve
548Coin Change2-D Dynamic ProgrammingKnapsack147 DSA SheetMediumSolve
549Coin Change II2-D Dynamic ProgrammingKnapsack147 DSA SheetMediumSolve
550Target Sum2-D Dynamic ProgrammingKnapsack147 DSA SheetMediumSolve
551Last Stone Weight II2-D Dynamic ProgrammingKnapsackMediumSolve
552Subset sum2-D Dynamic ProgrammingKnapsackMediumSolve
553Count subsets with sum K2-D Dynamic ProgrammingKnapsackMediumSolve
554Count partitions with a given difference2-D Dynamic ProgrammingKnapsackMediumSolve
555Unbounded knapsack2-D Dynamic ProgrammingKnapsackMediumSolve
556Rod cutting2-D Dynamic ProgrammingKnapsackHardSolve
558Longest Common Subsequence2-D Dynamic ProgrammingTwo strings147 DSA SheetMediumSolve
559Maximum Length of Repeated Subarray2-D Dynamic ProgrammingTwo stringsMediumSolve
560Edit Distance2-D Dynamic ProgrammingTwo strings147 DSA SheetMediumSolve
561Longest Palindromic Subsequence2-D Dynamic ProgrammingTwo stringsMediumSolve
562Distinct Subsequences2-D Dynamic ProgrammingTwo stringsHardSolve
563Interleaving String2-D Dynamic ProgrammingTwo stringsMediumSolve
564Wildcard Matching2-D Dynamic ProgrammingTwo stringsHardSolve
565Regular Expression Matching2-D Dynamic ProgrammingTwo stringsHardSolve
566Print a longest common subsequence2-D Dynamic ProgrammingTwo stringsMediumSolve
567Delete Operation for Two Strings2-D Dynamic ProgrammingTwo stringsMediumSolve
568Minimum Insertion Steps to Make a String Palindrome2-D Dynamic ProgrammingTwo stringsHardSolve
569Shortest Common Supersequence 2-D Dynamic ProgrammingTwo stringsHardSolve
570Count palindromic subsequences2-D Dynamic ProgrammingTwo stringsHardSolve
571Minimum ASCII Delete Sum for Two Strings2-D Dynamic ProgrammingTwo stringsMediumSolve
572Burst Balloons2-D Dynamic ProgrammingSplitting a range147 DSA SheetHardSolve
573Palindrome Partitioning II2-D Dynamic ProgrammingSplitting a rangeHardSolve
574Matrix chain multiplication2-D Dynamic ProgrammingSplitting a rangeHardSolve
575Minimum Cost to Cut a Stick2-D Dynamic ProgrammingSplitting a rangeHardSolve
576Partition Array for Maximum Sum2-D Dynamic ProgrammingSplitting a rangeMediumSolve
577Ways to evaluate a boolean expression to true2-D Dynamic ProgrammingSplitting a rangeHardSolve
598Partition to K Equal Sum Subsets2-D Dynamic ProgrammingBitmask DPMediumSolve
599Minimum Number of Work Sessions to Finish the Tasks2-D Dynamic ProgrammingBitmask DPMediumSolve
600Shortest Path Visiting All Nodes2-D Dynamic ProgrammingBitmask DPHardSolve
601Find the Shortest Superstring2-D Dynamic ProgrammingBitmask DPHardSolve
602Count Numbers with Unique Digits2-D Dynamic ProgrammingDigit DPMediumSolve
603Numbers At Most N Given Digit Set2-D Dynamic ProgrammingDigit DPHardSolve
604Count Special Integers2-D Dynamic ProgrammingDigit DPHardSolve
605Number of Digit One2-D Dynamic ProgrammingDigit DPHardSolve
578Find the Index of the First Occurrence in a StringString MatchingPattern matching147 DSA SheetEasySolve
579Shortest PalindromeString MatchingPattern matchingHardSolve
580Rabin-KarpString MatchingPattern matchingMediumSolve
581Z-functionString MatchingPattern matchingMediumSolve
582Repeated String MatchString MatchingPattern matchingMediumSolve
583Longest Happy PrefixString MatchingPattern matchingHardSolve
606Range minimum queriesRange QueriesSparse tableMediumSolve
607Range Sum Query - MutableRange QueriesFenwick treeMediumSolve
608Count of Smaller Numbers After SelfRange QueriesFenwick treeHardSolve
609Create Sorted Array through InstructionsRange QueriesFenwick treeHardSolve
610Range minimum with updatesRange QueriesSegment treeMediumSolve
611Longest Increasing Subsequence IIRange QueriesSegment treeHardSolve
612Booking Concert Tickets in GroupsRange QueriesSegment treeHardSolve
613Range add, range sumRange QueriesLazy propagationHardSolve
614My Calendar IIIRange QueriesLazy propagationHardSolve
615Falling SquaresRange QueriesLazy propagationHardSolve

Article

Send feedback

Thank you for helping. We read every report and fix what is wrong.

How do you feel about oneby7?

Sign in to oneby7

Keep your progress, your streak and your code, on any device.

New here? This creates your account too.