- 1. Two Sum Hash Table: O(N)
- 2. Add Two Numbers Linked List
- 3. Longest Substring Without Repeating Characters String: Sliding Window
- HARD 4. Median of Two Sorted Arrays Binary Search (Variation)
- 5. Longest Palindromic Substring DP, String: Palindrome, Manacher’s Algorithm
- 6. ZigZag Conversion String Manipulation
- 7. Reverse Integer Math, Integer Overflow
- 8. String to Integer (atoi) String, Integer
- 9. Palindrome Number Integer, Math
- HARD 10. Regular Expression Matching Recursion ->Top Down DP, Buttom Up Dp
- 11. Container With Most Water Recursion ->Array, Two Pointer
- 12. Integer to Roman String, Math
- 13. Roman to Integer String, Math
- 14. Longest Common Prefix String, Longest Common Prefix, Prefix Trie
- 15. 3Sum Array, Two Pointers
- 16. 3Sum Closest Array, Two Pointers
- 17. Letter Combinations of a Phone Number Backtracking
- 18. 4Sum Array, Two Pointers
- 19. Remove Nth Node From End of List LinkedList, Two Pointers
- 20. Valid Parentheses String, Parentheses, Stack
- 21. Merge Two Sorted Lists LinkedList, Recursion, Iteration
- 22. Generate Parentheses String, Backtracking
- HARD 23. Merge k-Sorted Lists LinkedList, Divide and Conque, PriorityQueue
- 24. Swap Nodes in Pairs LinkedList, Swap
- HARD 25. Reverse Nodes in k-Group LinkedList, Reverse
- 26. Remove Duplicates from Sorted Array Array, Two Pointers
- 27. Remove Element Array, Two Pointers
- 28. Implement strStr() Substring Search (Pattern Match), KMP, Rabin Karp (rolling hash)
- 29. Divide Two Integers Integer Manipulation, Binary Search
- HARD 30. Substring with Concatenation of All Words String, Hash Table
- 31. Next Permutation Array, Permutation
- HARD 32. Longest Valid Parentheses String, DP, Stack
- 33. Search in Rotated Sorted Array Array, Binary Search
- 34. Find First and Last Position of Element in Sorted Array Array, Binary Search on the left and right parts
- 35. Search Insert Position Array, Binary Search
- 36. Valid Sudoku 2D Array, HashSet
- HARD 37. Sudoku Solver 2D Array, BackTracking
- 38. Count and Say String, Recursion
- 39. Combination Sum Array, Backtracking
- 40. Combination Sum II Array, Backtracking
- HARD 41. First Missing Positive Array in-place operation
- HARD 42. Trapping Rain Water DP, Stack, Two Pointers
- 43. Multiply Strings String, Math
- HARD 44. Wildcard Matching String, Top Down DP (Recursion + Memoization)
- HARD 45. Jump Game II Array, Greedy
- 46. Permutations Permutation, Backtracking
- 47. Permutations II Permutation, Backtracking
- 48. Rotate Image Array Rotation, Transpose + Revserse rows
- 49. Group Anagrams String, Hash Table
- 50. Pow(x, n) Math, Fast Power Algorithm, Binary Search
- HARD 51. N-Queens DFS, Backtracking
- HARD 52. N-Queens II DFS, Backtracking
- 53. Maximum Subarray DP, Kadane’s algorithm, Divide and Conquer
- 54. Spiral Matrix Matrix
- 55. Jump Game
- 56. Merge IntervalsGreedy
- 59. Spiral Matrix II Graph, Matrix
- 67. Add Binary String, Math
- 70. Climbing Stairs DP
- 75. Sort Colors
- 78. Subsets
- 79. Word Search
- 95. Unique Binary Search Trees II
- 94. Binary Tree Inorder Traversal
- HARD 97. Interleaving StringRecurion –> DP
- 101. Symmetric TreeTree, BFS, DFS
- 104. Maximum Depth of Binary TreeTree, BFS, DFS
- 107. Binary Tree Level Order Traversal IITree, BFS, DFS (Level traversal)
- 108. Convert Sorted Array to Binary Search Tree Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree Binary Search Tree
- 112. Path Sum Tree, DFS
- 113. Path Sum II Tree, DFS, Backtracking
- 114. Flatten Binary Tree to Linked List Tree, Recursion
- 116. Populating Next Right Pointers in Each Node Tree, BFS, Iteration on levels
- 117.Populating Next Right Pointers in Each Node II Tree, BFS, Iteration on levels
- 119. Pascal’s Triangle II Recursion –> top down DP memoization
- 120. Triangle Recursion –> top down DP memoization (only “!=” works)
- 121. Best Time to Buy and Sell Stock
- 122. Best Time to Buy and Sell Stock II
- 125. Valid Palindrome String –> Two Pointers, Regular expression
- HARD 126. Word Ladder II
- HARD 127. Word Ladder Implicit Graph, BFS, Bidirectional Breadth First Search
- 129. Sum Root to Leaf Numbers Tree, DFS
- 130. Surrounded Regions Traversal of 2D grid, DFS, BFS
- 131. Palindrome Partitioning Backtracking, DP
- 133. Clone Graph DFS: Recursion and Iteration, BFS
- 136. Single Number
- 137. Single Number II Bitwise operators
- 138. Copy List with Random Pointer List, Constant Space Complexity, Recursion
- 139. Word Break DP, BSF, Recursion with flag
- HARD 140. Word Break II
- 141. Linked List Cycle Hash Table, Two Pointers
- 142. Linked List Cycle II Hash Table, Two Pointers
- 143. Reorder List List
- 144. Binary Tree Preorder Traversal Morris Traversal
- 146. LRU Cache LinkedHashMap == Hashmap + DoubleLinkedList
- 147. Insertion Sort List List, Insertion Sorting
- 148. Sort List List + MergeSort (Recursion VS. Bottom-Up)
- 150. Evaluate Reverse Polish Notation Construct tree with postorder tranversal using stack
- 151. Reverse Words in a String Java Collection
- 152. Maximum Product Subarray DP
- 153. Find Minimum in Rotated Sorted Array Binary Search
- 155. Min Stack Stack
- 156. Binary Tree Upside Down Tree (Recursion + Iteration)
- 159. Longest Substring with At Most Two Distinct Characters String: Sliding Window
- 160. Intersection of Two Linked Lists Two Pointers
- 161. One Edit Distance String
- 162. Find Peak Element Binary Search
- 163. Missing Ranges
- 165. Compare Version Numbers String, Two Pointers -> One Pass
- 167. Two Sum II - Input array is sorted Array, Two Pointers
- 168. Excel Sheet Column Title String
- 169. Majority Element
- 170. Two Sum III - Data structure design HashTable
- 172. Factorial Trailing Zeroes Math: Factorial
- 173. Binary Search Tree Iterator BST, Stack -> (space complexity O(logn))
- 179. Largest Number Arrays.sort()
- 180. Consecutive Numbers SQL
- 186. Reverse Words in a String II String: reverse string
- 187. Repeated DNA Sequences String: Pattern searching
- 189. Rotate Array Array, Cyclic Replacements, Reverse
- 190. Reverse Bits Bit Manipulation
- 198. House Robber mycode DP
- 199. Binary Tree Right Side View Tree, DFS, BFS
- 200. Number of Islands Traversal of 2D grid, DFS, BFS, Union-find
- 201. Bitwise AND of Numbers Range Bit Manipulation
- 202. Happy Number Cycle Detection: Hashset & Floyd’s Cycle-Finding Algorithm
- 203. Remove Linked List Elements LinkedList
- 204. Count Primes Finding Prime numbers - Sieve of Eratosthenes
- 205. Isomorphic Strings String
- 206. Reverse Linked ListList
- 207. Course Schedule Topological Sort, Directed graph cycle detection
- 208. Implement Trie (Prefix Tree) Trie
- 209. Minimum Size Subarray Sum Two Pointers
- 210. Course Schedule II Topological Sorting
- 211. Add and Search Word - Data structure design Trie
- HARD 212. Word Search II ____
- 213. House Robber II DP
- 215. Kth Largest Element in an Array Quickselect
- 216. Combination Sum III BackTracking
- 217. Contains Duplicate,219.Contains Duplicate II,220.Contains Duplicate III LinearSearch,BinarySearchTree,HashTable
- 221. Maximal Square Graph, DP: dp(i,j)=min(dp(i−1,j),dp(i−1,j−1),dp(i,j−1))+1
- 222. Count Complete Tree Nodes Search Algorithm: Linear Time, Binary search
- 223. Rectangle Area Math
- 226. Invert Binary Tree Tree
- 227. Basic Calculator II Stack
- 238. Product of Array Except Self
- 239. Sliding Window Maximum
- 240. Search a 2D Matrix II Graph, Binary Search, Divide & Conque
- 253. Meeting Rooms II
- HARD 269. Alien Dictionary
- HARD 273. Integer to English Words
- 279. Perfect Squares
- 283. Move Zeroes Array Transformation
- HARD 295. Find Median from Data Stream
- 297. Serialize and Deserialize Binary Tree
- 307. Range Sum Query - Mutable Segment Tree
- 322. Coin Change DP
- 347. Top K Frequent Elements HashMap, Heap (PriorityQueue, minHeap)
- 348. Design Tic-Tac-Toe
- 353. Design Snake Game Design
- 394. Decode String
- 438. Find All Anagrams in a String
- 448. Find All Numbers Disappeared in an Array
- HARD 460. LFU Cache Design, DoublyLinkedList
- HARD 472. Concatenated Words
- 449. Serialize and Deserialize BST
- 535. Encode and Decode TinyURL
- 542. 01 Matrix Graph, BFS
- 543. Diameter of Binary Tree
- 572. Subtree of Another Tree Tree, Recursion
- 581. Shortest Unsorted Continuous Subarray
- 588. Design In-Memory File System System Design, separate Directory and File List
- 559. Maximum Depth of N-ary Tree DFS, BFS
- 617. Merge Two Binary Trees
- 683. K Empty Slots Sliding Window
- 684. Redundant Connection Graph, Undirected graph cycle detection, DFS
- 688. Knight Probability in Chessboard
- 692. Top K Frequent Words HashMap, Heap (PriorityQueue, minHeap)
- 694. Number of Distinct Islands
- 763. Partition Labels String, Two Pointers, Greedy
- 819. Most Common Word String, split(regex)
- 863. All Nodes Distance K in Binary Tree Tree -> Undirected Graph
- 873. Length of Longest Fibonacci Subsequence
- 909. Snakes and Ladders Graph, BFS
- 937. Reorder Data in Log Files String, Custom Sort, TreeMap + PriorityQueue
- 957. Prison Cells After N Days Using hashset to detect cycle
- 973. K Closest Points to Origin Custom Sort, Min Heap, PriorityQueue
- 992. Subarrays with K Different Integers HashTable, Two Pointers, Sliding Windows
- 994. Rotting Oranges Graph, BFS
- 997. Find the Town Judge Graph,Topology
- 1032. Stream of Characters Trie
- 1116. Print Zero Even Odd
- 1120. Maximum Average Subtree Tree, Recursion
- 1152. Analyze User Website Visit Pattern
- 1162. As Far from Land as Possible BFS
- 1167. Minimum Cost to Connect Sticks
- HARD 1192. Critical Connections in a Network Graph, DFS with rank()
- 1268. Search Suggestions System Trie
- 1365. How Many Numbers Are Smaller Than the Current Number ____
- 1417. Reformat The String ____
- 1431. Kids With the Greatest Number of Candies
- 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Sliding Window
- 滴滴笔试题-集合DFS DFS