# 125 Essential Problems from LeetCode

## Arrays (10 problems)

Master the fundamentals of array manipulation, from basic traversals to advanced techniques.

### Easy Problems

1. [**Best Time to Buy and Sell Stock**](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) (#121) - Single pass tracking
    
2. [**Maximum Subarray**](https://leetcode.com/problems/maximum-subarray/) (#53) - Kadane's algorithm
    
3. [**Plus One**](https://leetcode.com/problems/plus-one/) (#66) - Array digit manipulation
    
4. [**Pascal's Triangle**](https://leetcode.com/problems/pascals-triangle/) (#118) - 2D array generation
    
5. [**Majority Element**](https://leetcode.com/problems/majority-element/) (#169) - Boyer-Moore voting
    
6. [**Missing Number**](https://leetcode.com/problems/missing-number/) (#268) - Math/XOR trick
    
7. [**Find Pivot Index**](https://leetcode.com/problems/find-pivot-index/) (#724) - Prefix sum
    

### Medium Problems

8. [**Product of Array Except Self**](https://leetcode.com/problems/product-of-array-except-self/) (#238) - Prefix/suffix products
    
9. [**Find All Numbers Disappeared in an Array**](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/) (#448) - In-place marking
    
10. [**Rotate Array**](https://leetcode.com/problems/rotate-array/) (#189) - Array rotation techniques
    

---

## Hashing - HashMaps & HashSets (15 problems)

Master the art of O(1) lookups and understand when and how to use hash-based data structures.

### Easy Problems

1. [**Two Sum**](https://leetcode.com/problems/two-sum/) (#1) - Classic HashMap for pair finding
    
2. [**Contains Duplicate**](https://leetcode.com/problems/contains-duplicate/) (#217) - HashSet basics
    
3. [**Valid Anagram**](https://leetcode.com/problems/valid-anagram/) (#242) - Character frequency map
    
4. [**Happy Number**](https://leetcode.com/problems/happy-number/) (#202) - HashSet for cycle detection
    
5. [**Intersection of Two Arrays**](https://leetcode.com/problems/intersection-of-two-arrays/) (#349) - Set operations
    
6. [**Single Number**](https://leetcode.com/problems/single-number/) (#136) - Bit manipulation vs hashing
    
7. [**Isomorphic Strings**](https://leetcode.com/problems/isomorphic-strings/) (#205) - Bijection with HashMap
    
8. [**Word Pattern**](https://leetcode.com/problems/word-pattern/) (#290) - Pattern matching with HashMap
    
9. [**First Unique Character in a String**](https://leetcode.com/problems/first-unique-character-in-a-string/) (#387) - Frequency counting
    

### Medium Problems

10. [**Group Anagrams**](https://leetcode.com/problems/group-anagrams/) (#49) - HashMap with string keys
    
11. [**Longest Consecutive Sequence**](https://leetcode.com/problems/longest-consecutive-sequence/) (#128) - HashSet for O(n) solution
    
12. [**Subarray Sum Equals K**](https://leetcode.com/problems/subarray-sum-equals-k/) (#560) - HashMap + prefix sum
    
13. [**Top K Frequent Elements**](https://leetcode.com/problems/top-k-frequent-elements/) (#347) - HashMap + bucket sort
    
14. [**LRU Cache**](https://leetcode.com/problems/lru-cache/) (#146) - HashMap + Doubly Linked List
    
15. [**Copy List with Random Pointer**](https://leetcode.com/problems/copy-list-with-random-pointer/) (#138) - HashMap for deep copy
    

---

## Two Pointers (12 problems)

Essential technique for optimizing array and string problems from O(n²) to O(n).

### Easy Problems

1. [**Move Zeroes**](https://leetcode.com/problems/move-zeroes/) (#283) - Basic two pointer
    
2. [**Remove Duplicates from Sorted Array**](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) (#26) - In-place manipulation
    
3. [**Merge Sorted Array**](https://leetcode.com/problems/merge-sorted-array/) (#88) - Two pointer merge
    
4. [**Valid Palindrome**](https://leetcode.com/problems/valid-palindrome/) (#125) - Two pointer from ends
    
5. [**Reverse String**](https://leetcode.com/problems/reverse-string/) (#344) - Two pointer swap
    
6. [**Two Sum II - Input Array Is Sorted**](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/) (#167) - Two pointer on sorted
    
7. [**Intersection of Two Arrays II**](https://leetcode.com/problems/intersection-of-two-arrays-ii/) (#350) - Two pointer intersection
    

### Medium Problems

8. [**3Sum**](https://leetcode.com/problems/3sum/) (#15) - Three pointers
    
9. [**Container With Most Water**](https://leetcode.com/problems/container-with-most-water/) (#11) - Greedy two pointer
    
10. [**Sort Colors**](https://leetcode.com/problems/sort-colors/) (#75) - Dutch flag problem
    
11. [**Remove Duplicates from Sorted Array II**](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) (#80) - Two pointer with count
    
12. [**3Sum Closest**](https://leetcode.com/problems/3sum-closest/) (#16) - Three pointer variant
    

---

## Linked Lists (10 problems)

Master pointer manipulation and understand the elegance of recursive solutions.

### Easy Problems

1. [**Reverse Linked List**](https://leetcode.com/problems/reverse-linked-list/) (#206) - Fundamental operation
    
2. [**Merge Two Sorted Lists**](https://leetcode.com/problems/merge-two-sorted-lists/) (#21) - Two pointer merge
    
3. [**Linked List Cycle**](https://leetcode.com/problems/linked-list-cycle/) (#141) - Floyd's cycle detection
    
4. [**Palindrome Linked List**](https://leetcode.com/problems/palindrome-linked-list/) (#234) - Fast/slow pointer
    
5. [**Remove Duplicates from Sorted List**](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) (#83) - Traversal
    
6. [**Intersection of Two Linked Lists**](https://leetcode.com/problems/intersection-of-two-linked-lists/) (#160) - Two pointer
    
7. [**Middle of the Linked List**](https://leetcode.com/problems/middle-of-the-linked-list/) (#876) - Fast/slow pointer
    

### Medium Problems

8. [**Remove Nth Node From End of List**](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) (#19) - Two pointer with gap
    
9. [**Add Two Numbers**](https://leetcode.com/problems/add-two-numbers/) (#2) - Linked list arithmetic
    
10. [**Linked List Cycle II**](https://leetcode.com/problems/linked-list-cycle-ii/) (#142) - Cycle detection + entry point
    

---

## Stacks (8 problems)

LIFO operations and their powerful applications in parsing and expression evaluation.

### Easy Problems

1. [**Valid Parentheses**](https://leetcode.com/problems/valid-parentheses/) (#20) - Classic stack
    
2. [**Implement Queue using Stacks**](https://leetcode.com/problems/implement-queue-using-stacks/) (#232) - Stack manipulation
    
3. [**Backspace String Compare**](https://leetcode.com/problems/backspace-string-compare/) (#844) - Stack simulation
    
4. [**Next Greater Element I**](https://leetcode.com/problems/next-greater-element-i/) (#496) - Monotonic stack intro
    
5. [**Min Stack**](https://leetcode.com/problems/min-stack/) (#155) - Stack with min operation
    

### Medium Problems

6. [**Evaluate Reverse Polish Notation**](https://leetcode.com/problems/evaluate-reverse-polish-notation/) (#150) - Expression evaluation
    
7. [**Daily Temperatures**](https://leetcode.com/problems/daily-temperatures/) (#739) - Monotonic stack
    
8. [**Decode String**](https://leetcode.com/problems/decode-string/) (#394) - Nested stack operations
    

---

## Queues & Priority Queues (7 problems)

FIFO operations and heap-based priority management.

### Easy Problems

1. [**Implement Stack using Queues**](https://leetcode.com/problems/implement-stack-using-queues/) (#225) - Queue manipulation
    
2. [**Number of Recent Calls**](https://leetcode.com/problems/number-of-recent-calls/) (#933) - Queue basics
    
3. [**Last Stone Weight**](https://leetcode.com/problems/last-stone-weight/) (#1046) - Max heap basics
    
4. [**KthLargest Element in a Stream**](https://leetcode.com/problems/kth-largest-element-in-a-stream/) (#703) - Min heap maintenance
    

### Medium Problems

5. [**Kth Largest Element in an Array**](https://leetcode.com/problems/kth-largest-element-in-an-array/) (#215) - Priority queue/quickselect
    
6. [**K Closest Points to Origin**](https://leetcode.com/problems/k-closest-points-to-origin/) (#973) - Priority queue
    
7. [**Task Scheduler**](https://leetcode.com/problems/task-scheduler/) (#621) - Priority queue + greedy
    

---

## Binary Trees (13 problems)

Tree traversals, recursive thinking, and structural properties.

### Easy Problems

1. [**Maximum Depth of Binary Tree**](https://leetcode.com/problems/maximum-depth-of-binary-tree/) (#104) - Basic DFS/BFS
    
2. [**Invert Binary Tree**](https://leetcode.com/problems/invert-binary-tree/) (#226) - Tree manipulation
    
3. [**Same Tree**](https://leetcode.com/problems/same-tree/) (#100) - Tree comparison
    
4. [**Symmetric Tree**](https://leetcode.com/problems/symmetric-tree/) (#101) - Mirror comparison
    
5. [**Binary Tree Inorder Traversal**](https://leetcode.com/problems/binary-tree-inorder-traversal/) (#94) - Traversal
    
6. [**Path Sum**](https://leetcode.com/problems/path-sum/) (#112) - Root-to-leaf path
    
7. [**Minimum Depth of Binary Tree**](https://leetcode.com/problems/minimum-depth-of-binary-tree/) (#111) - BFS/DFS
    
8. [**Balanced Binary Tree**](https://leetcode.com/problems/balanced-binary-tree/) (#110) - Height calculation
    
9. [**Diameter of Binary Tree**](https://leetcode.com/problems/diameter-of-binary-tree/) (#543) - Path through node
    
10. [**Subtree of Another Tree**](https://leetcode.com/problems/subtree-of-another-tree/) (#572) - Tree matching
    

### Medium Problems

11. [**Binary Tree Level Order Traversal**](https://leetcode.com/problems/binary-tree-level-order-traversal/) (#102) - BFS layers
    
12. [**Validate Binary Search Tree**](https://leetcode.com/problems/validate-binary-search-tree/) (#98) - BST property
    
13. [**Binary Tree Right Side View**](https://leetcode.com/problems/binary-tree-right-side-view/) (#199) - Level traversal
    

---

## Binary Search Trees (6 problems)

Leverage BST properties for efficient searching and manipulation.

### Easy Problems

1. [**Search in a Binary Search Tree**](https://leetcode.com/problems/search-in-a-binary-search-tree/) (#700) - BST basics
    
2. [**Convert Sorted Array to Binary Search Tree**](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) (#108) - BST construction
    
3. [**Lowest Common Ancestor of a Binary Search Tree**](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) (#235) - BST properties
    
4. [**Range Sum of BST**](https://leetcode.com/problems/range-sum-of-bst/) (#938) - BST traversal
    

### Medium Problems

5. [**Kth Smallest Element in a BST**](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) (#230) - Inorder traversal
    
6. [**Lowest Common Ancestor of a Binary Tree**](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/) (#236) - Tree recursion
    

---

## Graphs - BFS/DFS (10 problems)

Graph traversal techniques and their applications in connected components and shortest paths.

### Easy Problems

1. [**Flood Fill**](https://leetcode.com/problems/flood-fill/) (#733) - Basic DFS/BFS
    
2. [**Island Perimeter**](https://leetcode.com/problems/island-perimeter/) (#463) - Grid traversal
    
3. [**Find if Path Exists in Graph**](https://leetcode.com/problems/find-if-path-exists-in-graph/) (#1971) - Graph traversal
    

### Medium Problems

4. [**Number of Islands**](https://leetcode.com/problems/number-of-islands/) (#200) - DFS/BFS on grid
    
5. [**Max Area of Island**](https://leetcode.com/problems/max-area-of-island/) (#695) - DFS with counting
    
6. [**Rotting Oranges**](https://leetcode.com/problems/rotting-oranges/) (#994) - Multi-source BFS
    
7. [**Course Schedule**](https://leetcode.com/problems/course-schedule/) (#207) - Topological sort
    
8. [**Pacific Atlantic Water Flow**](https://leetcode.com/problems/pacific-atlantic-water-flow/) (#417) - Multi-source DFS
    
9. [**Clone Graph**](https://leetcode.com/problems/clone-graph/) (#133) - Graph traversal + copying
    
10. [**Word Search**](https://leetcode.com/problems/word-search/) (#79) - DFS with backtracking
    

---

## Binary Search (8 problems)

O(log n) searching and its creative applications beyond sorted arrays.

### Easy Problems

1. [**Binary Search**](https://leetcode.com/problems/binary-search/) (#704) - Classic binary search
    
2. [**First Bad Version**](https://leetcode.com/problems/first-bad-version/) (#278) - Binary search application
    
3. [**Search Insert Position**](https://leetcode.com/problems/search-insert-position/) (#35) - Binary search variant
    
4. [**Sqrt(x)**](https://leetcode.com/problems/sqrtx/) (#69) - Binary search on answer
    
5. [**Guess Number Higher or Lower**](https://leetcode.com/problems/guess-number-higher-or-lower/) (#374) - Interactive binary search
    

### Medium Problems

6. [**Find Peak Element**](https://leetcode.com/problems/find-peak-element/) (#162) - Binary search on unsorted
    
7. [**Search in Rotated Sorted Array**](https://leetcode.com/problems/search-in-rotated-sorted-array/) (#33) - Modified binary search
    
8. [**Find First and Last Position of Element in Sorted Array**](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) (#34) - Binary search bounds
    

---

## Sorting (5 problems)

Understanding different sorting algorithms and their applications.

### Easy Problems

1. [**Squares of a Sorted Array**](https://leetcode.com/problems/squares-of-a-sorted-array/) (#977) - Two pointer sorting
    
2. [**Sort Array By Parity**](https://leetcode.com/problems/sort-array-by-parity/) (#905) - Partition algorithm
    

### Medium Problems

3. [**Majority Element II**](https://leetcode.com/problems/majority-element-ii/) (#229) - Boyer-Moore extended
    
4. [**Merge Intervals**](https://leetcode.com/problems/merge-intervals/) (#56) - Sort + merge
    
5. [**Sort an Array**](https://leetcode.com/problems/sort-an-array/) (#912) - Implement sorting algorithm
    

---

## Divide and Conquer (6 problems)

Breaking problems into smaller subproblems and combining solutions.

### Easy Problems

1. [**Maximum Subarray**](https://leetcode.com/problems/maximum-subarray/) (#53) - Can use D&C approach
    
2. [**Majority Element**](https://leetcode.com/problems/majority-element/) (#169) - Can use D&C approach
    
3. [**Merge Two Sorted Lists**](https://leetcode.com/problems/merge-two-sorted-lists/) (#21) - Base for merge sort
    

### Medium Problems

4. [**Sort List**](https://leetcode.com/problems/sort-list/) (#148) - Merge sort on linked list
    
5. [**Kth Largest Element in an Array**](https://leetcode.com/problems/kth-largest-element-in-an-array/) (#215) - Quickselect
    
6. [**Search a 2D Matrix II**](https://leetcode.com/problems/search-a-2d-matrix-ii/) (#240) - D&C on matrix
    

---

## Greedy (8 problems)

Making locally optimal choices to reach global optimum.

### Easy Problems

1. [**Assign Cookies**](https://leetcode.com/problems/assign-cookies/) (#455) - Basic greedy
    
2. [**Maximum Units on a Truck**](https://leetcode.com/problems/maximum-units-on-a-truck/) (#1710) - Greedy sorting
    
3. [**Can Place Flowers**](https://leetcode.com/problems/can-place-flowers/) (#605) - Greedy placement
    
4. [**Lemonade Change**](https://leetcode.com/problems/lemonade-change/) (#860) - Greedy change-making
    

### Medium Problems

5. [**Jump Game**](https://leetcode.com/problems/jump-game/) (#55) - Greedy reachability
    
6. [**Jump Game II**](https://leetcode.com/problems/jump-game-ii/) (#45) - Greedy optimization
    
7. [**Gas Station**](https://leetcode.com/problems/gas-station/) (#134) - Greedy circular array
    
8. [**Meeting Rooms II**](https://leetcode.com/problems/meeting-rooms-ii/) (#253) - Interval scheduling
    

---

## Backtracking (8 problems)

Systematic exploration of solution space with pruning.

### Easy Problems

1. [**Letter Case Permutation**](https://leetcode.com/problems/letter-case-permutation/) (#784) - Basic backtracking
    
2. [**Binary Tree Paths**](https://leetcode.com/problems/binary-tree-paths/) (#257) - Tree backtracking
    

### Medium Problems

3. [**Combinations**](https://leetcode.com/problems/combinations/) (#77) - Classic backtracking
    
4. [**Permutations**](https://leetcode.com/problems/permutations/) (#46) - Permutation generation
    
5. [**Subsets**](https://leetcode.com/problems/subsets/) (#78) - Subset generation
    
6. [**Generate Parentheses**](https://leetcode.com/problems/generate-parentheses/) (#22) - Recursive generation
    

### Hard Problems (Essential Classics)

7. [**N-Queens**](https://leetcode.com/problems/n-queens/) (#51) - Classic constraint satisfaction
    
8. [**Sudoku Solver**](https://leetcode.com/problems/sudoku-solver/) (#37) - Constraint propagation
    

---
