Problems
150 coding interview problems, explained
The problems of the NeetCode 150 list, in 18 topics. The statements, the five hints for each problem and the explained solutions are Algo150’s own, with the reference in JavaScript, TypeScript and Python.
Arrays & Hashing (9)
- Contains DuplicateEasy
- Valid AnagramEasy
- Two SumEasy
- Group AnagramsMedium
- Top K Frequent ElementsMedium
- Product of Array Except SelfMedium
- Valid SudokuMedium
- Encode and Decode StringsMedium
- Longest Consecutive SequenceMedium
Two Pointers (5)
- Valid PalindromeEasy
- Two Sum II Input Array Is SortedMedium
- 3SumMedium
- Container With Most WaterMedium
- Trapping Rain WaterHard
Sliding Window (6)
Stack (6)
- Valid ParenthesesEasy
- Min StackMedium
- Evaluate Reverse Polish NotationMedium
- Daily TemperaturesMedium
- Car FleetMedium
- Largest Rectangle In HistogramHard
Binary Search (7)
Linked List (11)
- Reverse Linked ListEasy
- Merge Two Sorted ListsEasy
- Reorder ListMedium
- Remove Nth Node From End of ListMedium
- Copy List With Random PointerMedium
- Add Two NumbersMedium
- Linked List CycleEasy
- Find The Duplicate NumberMedium
- LRU CacheMedium
- Merge K Sorted ListsHard
- Reverse Nodes In K GroupHard
Trees (15)
- Invert Binary TreeEasy
- Maximum Depth of Binary TreeEasy
- Diameter of Binary TreeEasy
- Balanced Binary TreeEasy
- Same TreeEasy
- Subtree of Another TreeEasy
- Lowest Common Ancestor of a Binary Search TreeMedium
- Binary Tree Level Order TraversalMedium
- Binary Tree Right Side ViewMedium
- Count Good Nodes In Binary TreeMedium
- Validate Binary Search TreeMedium
- Kth Smallest Element In a BstMedium
- Construct Binary Tree From Preorder And Inorder TraversalMedium
- Binary Tree Maximum Path SumHard
- Serialize And Deserialize Binary TreeHard
Heap / Priority Queue (7)
Backtracking (10)
- Generate ParenthesesMedium
- SubsetsMedium
- Combination SumMedium
- PermutationsMedium
- Subsets IIMedium
- Combination Sum IIMedium
- Word SearchMedium
- Palindrome PartitioningMedium
- Letter Combinations of a Phone NumberMedium
- N QueensHard
Tries (3)
Graphs (13)
- Number of IslandsMedium
- Clone GraphMedium
- Max Area of IslandMedium
- Pacific Atlantic Water FlowMedium
- Surrounded RegionsMedium
- Rotting OrangesMedium
- Walls And GatesMedium
- Course ScheduleMedium
- Course Schedule IIMedium
- Redundant ConnectionMedium
- Number of Connected Components In An Undirected GraphMedium
- Graph Valid TreeMedium
- Word LadderHard
Advanced Graphs (6)
1-D Dynamic Programming (12)
- Climbing StairsEasy
- Min Cost Climbing StairsEasy
- House RobberMedium
- House Robber IIMedium
- Longest Palindromic SubstringMedium
- Palindromic SubstringsMedium
- Decode WaysMedium
- Coin ChangeMedium
- Maximum Product SubarrayMedium
- Word BreakMedium
- Longest Increasing SubsequenceMedium
- Partition Equal Subset SumMedium
2-D Dynamic Programming (11)
Greedy (8)
- Maximum SubarrayMedium
- Jump GameMedium
- Jump Game IIMedium
- Gas StationMedium
- Hand of StraightsMedium
- Merge Triplets to Form Target TripletMedium
- Partition LabelsMedium
- Valid Parenthesis StringMedium
Intervals (6)
- Insert IntervalMedium
- Merge IntervalsMedium
- Non Overlapping IntervalsMedium
- Meeting RoomsEasy
- Meeting Rooms IIMedium
- Minimum Interval to Include Each QueryHard
Math & Geometry (8)
- Rotate ImageMedium
- Spiral MatrixMedium
- Set Matrix ZeroesMedium
- Happy NumberEasy
- Plus OneEasy
- Pow(x, n)Medium
- Multiply StringsMedium
- Detect SquaresMedium
Bit Manipulation (7)
- Single NumberEasy
- Number of 1 BitsEasy
- Counting BitsEasy
- Reverse BitsEasy
- Missing NumberEasy
- Sum of Two IntegersMedium
- Reverse IntegerMedium