0% found this document useful (0 votes)
4 views2 pages

Must Know Leetcode Topics

Uploaded by

160420aid005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Must Know Leetcode Topics

Uploaded by

160420aid005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Must-Know LeetCode Topics & Questions

Essential LeetCode Topics & Patterns


1. Arrays
Patterns: Sliding window, prefix sum, two pointers, sorting Must-know Questions: - Maximum Subarray
(Kadane’s) — 53 - Best Time to Buy & Sell Stock I/II/III/IV — 121, 122, 123, 188 - Two Sum / 3Sum / 4Sum
— 1, 15, 18 - Product of Array Except Self — 238 - Container With Most Water — 11 - Trapping Rain
Water — 42 - Subarray Sum Equals K — 560 - Move Zeroes — 283 - Merge Intervals — 56

2. Strings
Patterns: Sliding window, hash map, two pointers, string matching Must-know Questions: - Longest
Substring Without Repeating Characters — 3 - Valid Anagram — 242 - Group Anagrams — 49 -
Minimum Window Substring — 76 - Palindrome Substrings — 647 - Implement strStr() — 28

3. Linked List
Patterns: Fast/slow pointers, dummy node, reversing list, cycle detection Must-know Questions: -
Reverse Linked List — 206 - Linked List Cycle — 141 - Merge Two Sorted Lists — 21 - Remove Nth Node
From End — 19 - Copy List with Random Pointer — 138 - Reorder List — 143

4. Trees / Binary Trees


Patterns: DFS (pre/in/post), BFS, recursion, tree DP Must-know Questions: - Maximum Depth / Min
Depth — 104, 111 - Validate Binary Search Tree — 98 - Symmetric Tree — 101 - Binary Tree Level Order
Traversal — 102 - Lowest Common Ancestor — 236 - Path Sum / Path Sum II — 112, 113 - Serialize /
Deserialize Binary Tree — 297

5. Graphs
Patterns: BFS, DFS, Union-Find, topological sort Must-know Questions: - Number of Islands — 200 -
Course Schedule I/II — 207, 210 - Clone Graph — 133 - Word Ladder — 127 - Graph Valid Tree — 261 -
Pacific Atlantic Water Flow — 417

6. Dynamic Programming
Patterns: 1D DP, 2D DP, memoization, bottom-up, state compression Must-know Questions: - Climbing
Stairs — 70 - House Robber I/II/III — 198, 213, 337 - Longest Increasing Subsequence — 300 - Coin
Change — 322 - Minimum Path Sum — 64 - Decode Ways — 91 - Unique Paths / Unique Paths II — 62,
63 - Maximum Subarray (Kadane’s) — 53 - Edit Distance — 72

1
7. Backtracking / Recursion
Patterns: DFS, combination/permutation, subset generation Must-know Questions: - Subsets — 78 -
Permutations — 46 - Combination Sum I/II — 39, 40 - Word Search — 79 - N-Queens — 51

8. Heaps / Priority Queue


Patterns: Min-heap / max-heap, sliding window Must-know Questions: - Top K Frequent Elements — 347
- Kth Largest Element in Array — 215 - Merge K Sorted Lists — 23 - Sliding Window Maximum — 239

9. Hashing
Patterns: Frequency counting, two sum, prefix sum with hashmap Must-know Questions: - Two Sum —
1 - Subarray Sum Equals K — 560 - Valid Anagram — 242 - Group Anagrams — 49 - Longest Consecutive
Sequence — 128

10. Two Pointers


Patterns: Opposite ends, sliding window, fast/slow Must-know Questions: - Two Sum II — 167 -
Container With Most Water — 11 - 3Sum / 3Sum Closest — 15, 16 - Trapping Rain Water — 42 - Remove
Duplicates from Sorted Array — 26

Key Patterns to Master


1. Sliding Window → substring, subarray sums
2. Prefix Sum → subarray sum problems
3. Kadane’s → max subarray problems
4. Two Pointers → sorted array or string
5. Fast & Slow → cycles in linked lists
6. DFS / BFS → trees & graphs
7. Dynamic Programming → optimal substructure
8. Backtracking → permutations, combinations, subsets
9. Heap → top-k, merge k sorted lists

You might also like