| ID | 問題 | 頻率 | 數(shù)據(jù)結構 | 算法 |
|---|---|---|---|---|
| 1 | Two Sum | 5 | array、set | sort、Two Pointers |
| 8 | String to Integer (atoi) | 5 | string | Math |
| 20 | Valid Parentheses | 5 | string | Stack |
| 15 | 3Sum | 5 | array | Two Pointers |
| 21 | Merge Two Sorted Lists | 5 | linked list | sort、Two Pointers、merge |
| 28 | Implement strStr() | 5 | string | Two Pointers、KMP、rolling hash |
| 50 | Pow(x, n) | 5 | Binary | Search、Math |
| 56 | Merge Intervals | 5 | Array,linklist,rb tree | sort、merge |
| 57 | Insert Interval | 5 | array | sort |
| 65 | Valid Number | 5 | string | Math |
| 73 | Set Matrix Zeroes | 5 | array | - |
| 88 | Merge Sorted Array | 5 | array | Two Pointers、merge |
| 98 | Validate Binary Search Tree | 5 | tree | DFS |
| 125 | Valid Palindrome | 5 | string | Two Pointers |
| 127 | Word Ladder | 5 | graph | BFS、path |
| 5 | Longest Palindromic Substring | 5 | string | 5 |
| 2 | Add Two Numbers | 4 | linked list | Two Pointers、Math |
| 12 | Integer to Roman | 4 | - | Math |
| 13 | Roman to Integer | 4 | - | Math |
| 22 | Generate Parentheses | 4 | string | DFS |
| 23 | Merge k Sorted Lists | 4 | linked list | heap sort、Two Pointersmerge |
| 24 | Swap Nodes in Pairs | 4 | linked list | - |
| 27 | Remove Element | 4 | array | Two Pointers |
| 46 | Permutations | 4 | array | permutation |
| 49 | Anagrams | 4 | string | hashtable |
| 67 | Add Binary | 4 | string | Two Pointers、Math |
| 69 | Sqrt(x) | 4 | - | Binary Search |
| 77 | Combinations | 4 | - | combination |
| 78 | Subsets | 4 | array | Recursion、combination |
| 79 | Word Search | 4 | array | DFS |
| 91 | Decode Ways | 4 | string | Recursion、DP |
| 102 | Binary Tree Level Order Traversal | 4 | tree | BFS |
| 129 | Sum Root to Leaf Numbers | 4 | tree | DFS |
| 131 | Palindrome Partitioning | 4 | string | DFS |
| 4 | Median of Two Sorted Arrays | 3 | array | Binary Search |
| 7 | Reverse Integer | 3 | - | Math |
| 10 | Regular Expression Matching | 3 | string | Recursion、DP |
| 17 | Letter Combinations of a Phone Number | 3 | string | DFS |
| 19 | Remove Nth Node From End of List | 3 | linked list | Two Pointers |
| 26 | Remove Duplicates from Sorted Array | 3 | array | Two Pointers |
| 29 | Divide Two Integers | 3 | - | Binary Search |
| 33 | Search in Rotated Sorted Array | 3 | array | Binary Search |
| 34 | Search for a Range | 3 | array | Binary Search |
| 39 | Combination Sum | 3 | array | combination |
| 43 | Multiply Strings | 3 | string | Two Pointers、Math |
| 44 | Wildcard Matching | 3 | string | Recursion、DP、greedy |
各個頻率的題目總結如下:
頻率5 http://www.itdecent.cn/p/f1b154c780c6
頻率4 http://www.itdecent.cn/p/9988972fd346
頻率3 http://www.itdecent.cn/p/41a6bf4558f8