- Shuffle
- HashMap
- Pointers
- LRU/LFU cache and Trie
- Queue/Stack with tuple
- Monotonic stack/queue
- Level order/BFS/Topological sort
- Kadane
- Interval
- Sliding window
- Divide and conquor
- Priority queue
- Quick select/Merge sort
- Union find
- DFS/Check cycle
- Recursion and memoization
- All path(backtracking)
Short Core:
- Binary Search
- Quick Select
- DP, Search, Backtracking
- Graph(Add/Remove Vertex/Edge, DFS, BFS, hasCycle, shortestPath, topologicalSort)
- LRU, LFU cache
- Interval
Group | # | Category | # | Questions | R | I | Blind |
---|---|---|---|---|---|---|---|
A.Tabulation | 1.1 | Conbination DP | 1 | 55. Jump Game | ✓ | ✓ | ✓ |
Recursion/Memo | 2 | 62. Unique Paths | ✓ | ✓ | ✓ | ||
3 | 64. Minimum Path Sum | ✓ | ✓ | ||||
4 | 70. Climbing Stairs | ✓ | ✓ | ✓ | |||
5 | 91. Decode Ways | ✓ | ✓ | ✓ | |||
6 | 118. Pascal's Triangle | ✓ | ✓ | ||||
7 | 139. Word Break | ✓ | ✓ | ✓ | |||
8 | 300. Longest Increasing Subsequence | ✓ | ✓ | ✓ | |||
9 | 322. Coin Change | ✓ | ✓ | ✓ | |||
10 | 416. Partition Equal Subset Sum | ✓ | ✓ | ||||
11 | 494. Target Sum | ✓ | ✓ | ||||
12 | 1143. Longest Common Subsequence | ✓ | ✓ | ✓ | |||
1.2 | Local/Global DP | 1 | 128. Longest Consecutive Sequence | ✓ | ✓ | ✓ | |
2 | 134. Gas Station | ✓ | ✓ | ||||
3 | 221. Maximal Square | ✓ | ✓ | ||||
4 | 279. Perfect Squares | ✓ | ✓ | ||||
1.3 | Kadane DP | 1 | 53. Maximum Subarray | ✓ | ✓ | ||
2 | 152. Maximum Product Subarray | ✓ | ✓ | ||||
1.4 | Decision Making DP | 1 | 198. House Robber | ✓ | ✓ | ✓ | |
2 | 213. House Robber II | ✓ | ✓ | ✓ | |||
3 | 121. Best Time to Buy and Sell Stock | ✓ | ✓ | ✓ | |||
4 | 309. Best Time to Buy and Sell Stock with Cooldown | ✓ | ✓ | ||||
1.5 | Two String Matching DP | 1 | 5. Longest Palindromic Substring | ✓ | ✓ | ✓ | |
2 | 10 Regular Expression Matching | ✓ | ✓ | ||||
3 | 44. Wildcard Matching | ✓ | ✓ | ||||
4 | 72. Edit Distance | ✓ | ✓ | ||||
5 | 647. Palindromic Substrings | ✓ | ✓ | ✓ | |||
1.6 | Two Direction DP | 1 | 11. Container With Most Water | ✓ | ✓ | ✓ | |
2 | 238. Product of Array Except Self | ✓ | ✓ | ✓ | |||
1.7 | Merging Intervals DP | 1 | 96. Unique Binary Search Trees | ✓ | ✓ | ||
2 | 312. Burst Balloons | ✓ | ✓ | ||||
2.1 | Overlapping Interval | 1 | 56. Merge Interval | ✓ | ✓ | ||
2 | 57. Insert Interval | ✓ | ✓ | ||||
3 | 252. Meeting Rooms | ✓ | ✓ | ||||
4 | 253. Meeting Rooms II | ✓ | ✓ | ||||
2.2 | Max non-overlapping Interval | 5 | 435. Non-overlapping Intervals | ✓ | ✓ | ||
6 | 452. Minimum Number of Arrows to Burst Balloons | ✓ | |||||
2.3 | Intersection 2 pointers | 7 | 986. Interval List Intersections | ✓ | |||
8 | 1229. Meeting Scheduler | ✓ | |||||
3 | Binary Search | 1 | 278. First Bad Version | ✓ | |||
2 | 69. Sqrt(x) | ✓ | ✓ | ||||
3 | 35. Search Insert Position | ✓ | |||||
4 | 981. Time Based Key-Value Store | ✓ | |||||
5 | 1011. Capacity To Ship Packages Within D Days | ✓ | |||||
6 | 410. Split Array Largest Sum | ✓ | |||||
7 | 875. Koko Eating Bananas | ✓ | |||||
8 | 1482. Minimum Number of Days to Make m Bouquets | ✓ | |||||
9 | 668. Kth Smallest Number in Multiplication Table | ✓ | |||||
10 | 719. Find K-th Smallest Pair Distance | ✓ | |||||
11 | 1201. Ugly Number III | ✓ | |||||
12 | 1283. Find the Smallest Divisor Given a Threshold | ✓ | |||||
13 | 4. Median of Two Sorted Arrays | ✓ | |||||
14 | 33. Search in Rotated Sorted Array | ✓ | ✓ | ||||
15 | 34. Search for a Range (First and Last Position) | ✓ | |||||
16 | 153. Minimum in Rotated Sorted Array | ✓ | ✓ | ✓ | |||
17 | 162. Find Peak Element | ✓ | ✓ | ||||
18 | 287. Find the Duplicate Number | ✓ | ✓ | ||||
19 | 300. Longest Increasing Subsequence | ✓ | |||||
20 | 378. Kth Smallest Element in a Sorted Matrix | ✓ | |||||
4.1 | Sliding Window | 1 | 3. Longest Substring Without Repeating Characters | ✓ | ✓ | ||
2 | 76. Minimum Window Substring | ✓ | ✓ | ||||
3 | 340. Longest Substring with At Most K Distinct Characters | ✓ | |||||
4 | 395. Longest Substring with At Least K Repeating Characters | ✓ | |||||
5 | 424. Longest Repeating Character Replacement | ✓ | ✓ | ||||
6 | 438. Find All anagrams in a String | ✓ | |||||
7 | 763. Partition Labels | ✓ | |||||
4.2 | HashMap | 1 | 1. Two Sum | ✓ | ✓ | ||
2 | 13. Roman to Integer | ✓ | |||||
3 | 49. Group Anagrams | ✓ | ✓ | ||||
4 | 138. Copy List with Random Pointer | ✓ | |||||
5 | 169. Majority Element | ✓ | |||||
6 | 217. Contains Duplicate | ✓ | ✓ | ||||
7 | 242. Valid Anagram | ✓ | ✓ | ||||
8 | 350. Intersection of Two Arrays II | ✓ | |||||
9 | 380. Insert Delete GetRandom O(1) | ✓ | |||||
10 | 387. First Unique Character in a String | ✓ | |||||
11 | 454. 4Sum II | ✓ | |||||
12 | 560. subarray Sum Equals K | ✓ | |||||
4.3 | Prefix Sum | 1 | 308. Range Sum Query 2D - Mutable | ✓ | |||
2 | 560. Subarray Sum Equals K | ✓ | |||||
5.1 | Pointers | 1 | 15. 3Sum | ✓ | ✓ | ||
2 | 26. Remove Duplicates from Sorted Array | ✓ | |||||
3 | 48. Rotate Image | ✓ | ✓ | ||||
4 | 54. Spiral Matrix | ✓ | ✓ | ||||
5 | 66. Plus One | ✓ | |||||
6 | 73. Set Matrix Zeros | ✓ | ✓ | ||||
7 | 88. Merge Sorted Array | ✓ | |||||
8 | 116. Populating Next Right Pointers in Each Node | ✓ | ✓ | ||||
9 | 125. Valid Palindrome | ✓ | ✓ | ||||
10 | 163. Missing Ranges | ✓ | |||||
11 | 240. Search a 2D Matrix II | ✓ | ✓ | ||||
12 | 251. Flatten 2D Vector | ✓ | |||||
13 | 277. Find the Celebrity | ✓ | |||||
14 | 283. Move Zeros | ✓ | |||||
15 | 412. Fizz Buzz | ✓ | |||||
16 | 581. Shortest Unsorted Continuous Subarray | ✓ | ✓ | ||||
17 | 763. Partition Labels | ✓ | ✓ | ||||
5.2 | Negative Mark | 1 | 448. Find All Numbers Disappeared in an Array | ✓ | |||
5.3 | XOR | 1 | 136. Single Number | ✓ | |||
2 | 268. Missing Number | ✓ | ✓ | ||||
5.4 | Bit Manipulation | 1 | 190. Reverse Bits | ✓ | ✓ | ||
2 | 191. Number of 1 Bits | ✓ | ✓ | ||||
3 | 289. Game of Life | ✓ | |||||
4 | 338. Counting Bits | ✓ | ✓ | ||||
5 | 371. Sum of Two Integers | ✓ | ✓ | ||||
B.Recursion | 0 | Recursion | 1 | 172. Factorial Trailing Zeros | ✓ | ||
1 | Backtracking | 1 | 17. Letter Combinations of a Phone Number | ✓ | |||
2 | 39. Combination Sum | ✓ | ✓ | ||||
3 | 46. Permutations | ✓ | |||||
4 | 78. Subsets | ✓ | |||||
5 | 131. Palindrome Partitioning | ✓ | |||||
Recursion/DFS | 2.1 | DFS | 1 | 22. Generate Parentheses | ✓ | ||
2 | 94. Binary Tree Inorder Traversal | ✓ | |||||
3 | 104. Maximum Depth of Binary Tree | ✓ | ✓ | ||||
2.2 | Postorder DFS | 1 | 101. Symmetric Tree | ✓ | |||
2 | 124. Binary Tree Maximum Path Sum | ✓ | ✓ | ||||
3 | 236. Lowest Common Ancestor of a Binary Tree | ✓ | ✓ | ||||
4 | 543. Diameter of Binary Tree | ✓ | |||||
2.3 | Divide and Conquer DFS | 1 | 23 Merge k Sorted Lists | ✓ | ✓ | ||
2 | 98. Validate Binary Search Tree | ✓ | ✓ | ||||
3 | 105. Construct Binary Tree from Preorder and Inorder Traversal | ✓ | ✓ | ||||
4 | 108. Convert Sorted Array to Binary Search Tree | ✓ | |||||
5 | 148. Sort List | ✓ | |||||
6 | 212. Word Search II | ✓ | |||||
7 | 218. The Skyline Problem | ✓ | |||||
8 | 230. Kth Smallest Element in BST | ✓ | ✓ | ||||
9 | 285. Inorder Successor in BST | ✓ | |||||
10 | 617. Merge Two Binary Trees | ✓ | |||||
2.4 | Divide and Conquer DFS with Memo | 1 | 337. House Robber III | ✓ | |||
2 | 437. Path Sum III | ✓ | |||||
3 | 572. Subtree of Another Tree | ✓ | ✓ | ||||
Recursion/Search | 3.1 | DFS and Checked | 1 | 79. Word Search | ✓ | ✓ | |
2 | 127. Word Ladder | ✓ | |||||
3 | 130. Surrounded Regions | ✓ | |||||
4 | 133. Clone Graph | ✓ | ✓ | ||||
5 | 140. Word Break II | ✓ | |||||
6 | 200. Number of Islands | ✓ | ✓ | ||||
7 | 329. Longest Increasing Path in a Matrix | ✓ | |||||
8 | 417. Pacific Atlantic Water Flow | ✓ | ✓ | ||||
3.1.2 | Union Find | 1 | 130. Surrounded Regions | ✓ | |||
2 | 200. Number of Islands | ✓ | |||||
3 | 261. Graph Valid Tree | ✓ | ✓ | ||||
3.2 | BFS and Checked | 1 | 127. Word Ladder | ✓ | |||
2 | 130. Surrounded Regions | ✓ | |||||
3.3 | Trie Tree | 1 | 208. Implement Trie | ✓ | ✓ | ||
2 | 211. Add and Search Word - Data structure design | ✓ | ✓ | ✓ | |||
3 | 212. Word Search II | ✓ | ✓ | ||||
3.4 | Matrix and Checked | 1 | 36. Valid sudoku | ✓ | ✓ | ||
2 | 289. Game of Life | ✓ | |||||
3 | 348. Design Tic-Tac-Toe | ✓ | |||||
Recursion/Graph | 4.1 | Graph, DFS and Check cycle | 1 | 207. Course Schedule | ✓ | ✓ | |
2 | 210. Course Schedule II | ✓ | |||||
3 | 323. Number of Connected Components in an Undirected Graph | ✓ | ✓ | ||||
4.2 | Graph, BFS and Topological Sort | 1 | 207. Course Schedule | ✓ | ✓ | ||
2 | 210. Course Schedule II | ✓ | |||||
3 | 269. Alien Dictionary | ✓ | ✓ | ||||
4.3 | Bellman-Ford, Dijkstra | 1 | 743. Network Delay Time | ✓ | |||
C.Quick Select | 1 | Quick Select Partition | 1 | 75. Sort Colors | ✓ | ||
2 | 215. Kth Largest Element in an Array | ✓ | |||||
3 | 324. Wiggle Sort II | ✓ | |||||
2.1 | Quick Sort | ✓ | |||||
2.2 | Merge Sort | 1 | 315. Count of Smaller Numbers After Self | ✓ | |||
2.3 | Shuffle | 1 | 215. Kth Largest Element in an Array | ✓ | |||
2 | 324. Wiggle Sort II | ✓ | |||||
3 | 384. Shuffle an Array | ✓ | |||||
2.4.1 | Swap | 1 | 41. First Missing Positive | ✓ | |||
2 | 344. Reverse String | ✓ | |||||
3 | 380. Insert Delete GetRandom O(1) | ✓ | |||||
4 | 448. Find All Numbers Disappeared in an Array | ✓ | |||||
2.4.2 | 3 Way Reverse | 1 | 189. Rotate Array | ✓ | |||
D.Linked List | 1 | Linked List | 1 | 2. Add Two Numbers | ✓ | ✓ | |
2 | 19. Remove Nth Node From End of List | ✓ | ✓ | ✓ | |||
3 | 21. Merge Two Sorted Lists | ✓ | ✓ | ✓ | |||
4 | 141. Linked List Cycle | ✓ | ✓ | ✓ | |||
5 | 142. Linked List Cycle II | ✓ | |||||
6 | 143. Reorder List | ✓ | ✓ | ✓ | |||
7 | 148. Sort List | ✓ | ✓ | ||||
8 | 160. Intersection of Two Linked Lists | ✓ | ✓ | ||||
9 | 206. Reverse Linked List | ✓ | ✓ | ✓ | |||
10 | 234. Palindrome Linked List | ✓ | ✓ | ||||
11 | 237. Delete Node in a Linked List | ✓ | ✓ | ||||
12 | 285. Inorder Successor in BST | ✓ | ✓ | ||||
13 | 287. Find the Duplicate Number | ✓ | ✓ | ||||
14 | 328. Odd Even Linked List | ✓ | ✓ | ||||
2 | Double Linked List | 1 | 146. LRU Cache | ✓ | |||
2 | 460. LFU Cache | ✓ | |||||
E.BFS | 1 | BFS | 1 | 45. Jump Game II | ✓ | ✓ | |
2 | 226. Invert Binary Tree | ✓ | ✓ | ✓ | |||
3 | 297. Serialize and Deserialize Binary Tree | ✓ | ✓ | ✓ | |||
2.1 | Queue | 1 | 101. Symmetric Tree | ✓ | |||
2 | 102. Binary Tree Level Order Traversal | ✓ | ✓ | ||||
3 | 103. Binary Tree Zigzag Level Order Traversal | ✓ | |||||
4 | 116. Populating Next Right Pointers in Each Node | ✓ | |||||
2.2 | Monotonic Queue | 1 | 239. Sliding Window Maximum | ✓ | |||
3.1 | Stack | 1 | 20. Valid Parentheses | ✓ | ✓ | ✓ | |
2 | 32. Longest Valid Parentheses | ✓ | ✓ | ||||
3 | 94. Binary Tree Inorder Traversal | ✓ | ✓ | ||||
4 | 100. Same Tree | ✓ | ✓ | ✓ | |||
5 | 104. Maximum Depth of Binary Tree | ✓ | ✓ | ||||
6 | 114. Flatten Binary Tree to Linked List | ✓ | ✓ | ||||
7 | 150. Evaluate Reverse Polish Notation | ✓ | ✓ | ||||
8 | 225. Implement Stack using Queues | ✓ | |||||
9 | 232. Implement Queue using Stacks | ✓ | |||||
10 | 155. Min Stack | ✓ | |||||
11 | 227. Basic Valculator II | ✓ | ✓ | ||||
12 | 230. Kth Smallest Element in BST | ✓ | ✓ | ||||
13 | 236. Lowest Common Ancestor of a Binary Tree | ✓ | ✓ | ||||
14 | 341. Flatten Nested List Iterator | ✓ | ✓ | ||||
15 | 394. Decode String | ✓ | |||||
16 | 739. Daily Temperatures | ✓ | ✓ | ||||
3.2 | Monotonic Stack | 1 | 496. Next Greater Element I | ✓ | |||
2 | 503. Next Greater Element II | ✓ | |||||
3 | 42. Trapping Rain Water | ✓ | ✓ | ||||
4 | 84. Largest Rectangle Histogram | ✓ | |||||
5 | 85. Maximal Rectangle | ✓ | |||||
F.Others | 1 | Math Division | 1 | 7. Reverse Integer | ✓ | ||
2 | 8. String to Integer (atoi) | ✓ | |||||
3 | 29. Divide Two Integers | ✓ | ✓ | ||||
4 | 50. Pow(x, n) | ✓ | |||||
5 | 166. Fraction to Recurring Decimal | ✓ | ✓ | ||||
6 | 202. Happy Number | ✓ | |||||
7 | 204. Count Primes | ✓ | |||||
2 | Substring | 1 | 14. Longest Common Prefix | ✓ | ✓ | ||
2 | 28. Implement strStr() | ✓ | ✓ | ||||
3 | 38. Count and Say | ✓ | ✓ | ||||
4 | 271. Encode and Decode Strings | ✓ | ✓ | ✓ | |||
3 | Greedy | 1 | 122. Best Time to Buy and Sell Stock II | ✓ | |||
2 | 326. Power of Three | ✓ | |||||
3 | 334. Increasing Triplet Subsequence | ✓ | |||||
4 | Point centered gcd | 1 | 149. Max Points on a Line | ✓ | |||
5 | Moore's Voting algorithm | 1 | 169. Majority Element | ✓ | |||
6 | ASCII | 1 | 171. Excel Sheet Column Number | ✓ | |||
2 | 621. Task Scheduler | ✓ | |||||
7 | Sorting Variation | 1 | 179. Largest Number | ✓ | |||
2 | 324. Wiggle Sort II | ✓ | |||||
3 | 347. Top K Frequent Elements | ✓ | ✓ | ||||
4 | 406. Queue Reconstruction by Height | ✓ | |||||
8 | Heap | 1 | 215. Kth Largest Element in an Array | ✓ | |||
2 | 295. find Median from Data Stream | ✓ | ✓ | ||||
3 | 743. Network Delay Time | ✓ | |||||
9 | Binary Search Tree | 1 | 315. Count of Smaller Numbers After Self | ✓ | |||
10 | Binary Indexed Tree | 1 | 315. Count of Smaller Numbers After Self | ✓ |