首页 > 代码库 > LeetCode 刷题顺序表

LeetCode 刷题顺序表

Id
Question
Difficulty
Frequency
Data Structures
Algorithms
1Two Sum25array + setsort + two pointers
2Add Two Numbers34linked listtwo pointers + math
3Longest Substring Without Repeating Characters32string + hashtabletwo pointers
4Median of Two Sorted Arrays53arraybinary search
5Longest Palindromic Substring42string 
6ZigZag Conversion31string 
7Reverse Integer23 math
8String to Integer (atoi)25stringmath
9Palindrome Number22 math
10Regular Expression Matching53stringrecursion + dp
11Container With Most Water32arraytwo pointers
12Integer to Roman34 math
13Roman to Integer24 math
14Longest Common Prefix21string 
153Sum35arraytwo pointers
163Sum Closest31arraytwo pointers
17Letter Combinations of a Phone Number33stringdfs
184Sum32array 
19Remove Nth Node From End of List23linked listtwo pointers
20Valid Parentheses25stringstack
21Merge Two Sorted Lists25linked listsort + two pointers + merge
22Generate Parentheses34stringdfs
23Merge k Sorted Lists34linked list + heapsort + two pointers + merge
24Swap Nodes in Pairs24linked list 
25Reverse Nodes in k-Group42linked listrecursion + two pointers
26Remove Duplicates from Sorted Array13arraytwo pointers
27Remove Element14arraytwo pointers
28Implement strStr()45stringtwo pointers + KMP + rolling hash
29Divide Two Integers43 binary search + math
30Substring with Concatenation of All Words31stringtwo pointers
31Next Permutation52arraypermutation
32Longest Valid Parentheses41stringdp
33Search in Rotated Sorted Array43arraybinary search
34Search for a Range43arraybinary search
35Search Insert Position22array 
36Valid Sudoku22array 
37Sudoku Solver42arraydfs
38Count and Say22stringtwo pointers
39Combination Sum33arraycombination
40Combination Sum II42arraycombination
41First Missing Positive52arraysort
42Trapping Rain Water42arraytwo pointers + stack
43Multiply Strings43stringtwo pointers + math
44Wildcard Matching53stringrecursion + dp + greedy
45Jump Game II42array 
46Permutations34arraypermutation
47Permutations II42arraypermutation
48Rotate Image42array 
49Anagrams34string + hashtable 
50Pow(x, n)35 binary search + math
51N-Queens43arraydfs
52N-Queens II43arraydfs
53Maximum Subarray33arraydp
54Spiral Matrix42array 
55Jump Game32array 
56Merge Intervals45array + linked list + red-black treesort + merge
57Insert Interval45array + linked list + red-black treesort + merge
58Length of Last Word11string 
59Spiral Matrix II32array 
60Permutation Sequence51 permutation + math
61Rotate List32linked listtwo pointers
62Unique Paths23arraydp
63Unique Paths II33arraydp
64Minimum Path Sum33arraydp
65Valid Number25stringmath
66Plus One12arraymath
67Add Binary24stringtwo pointers + math
68Text Justification42string 
69Sqrt(x)44 binary search
70Climbing Stairs25 dp
71Simplify Path31stringstack
72Edit Distance43stringdp
73Set Matrix Zeroes35array 
74Search a 2D Matrix33arraybinary search
75Sort Colors42arraysort + two pointers
76Minimum Window Substring42stringtwo pointers
77Combinations34 combination
78Subsets34arrayrecursion + combination
79Word Search34arraydfs
80Remove Duplicates from Sorted Array II22arraytwo pointers
81Search in Rotated Sorted Array II53arraybinary search
82Remove Duplicates from Sorted List II33linked listrecursion + two pointers
83Remove Duplicates from Sorted List13linked list 
84Largest Rectangle in Histogram52arraystack
85Maximal Rectangle51arraydp + stack
86Partition List33linked listtwo pointers
87Scramble String52stringrecursion + dp
88Merge Sorted Array25arraytwo pointers + merge
89Gray Code42 combination
90Subsets II42arrayrecursion + combination
91Decode Ways34stringrecursion + dp
92Reverse Linked List II32linked listtwo pointers
93Restore IP Addresses33stringdfs
94Binary Tree Inorder Traversal43tree + hashtablerecursion + morris + stack
95Unique Binary Search Trees II41treedp + dfs
96Unique Binary Search Trees31treedp
97Interleaving String52stringrecursion + dp
98Validate Binary Search Tree35treedfs
99Recover Binary Search Tree42treedfs
100Same Tree11treedfs
101Symmetric Tree12treedfs
102Binary Tree Level Order Traversal34treebfs
103Binary Tree Zigzag Level Order Traversal43queue + treebfs + stack
104Maximum Depth of Binary Tree11treedfs
105Construct Binary Tree from Preorder and Inorder Tr33array + treedfs
106Construct Binary Tree from Inorder and Postorder T33array + treedfs
107Binary Tree Level Order Traversal II31treebfs
108Convert Sorted Array to Binary Search Tree23treedfs
109Convert Sorted List to Binary Search Tree43linked listrecursion + two pointers
110Balanced Binary Tree12treedfs
111Minimum Depth of Binary Tree11treedfs
112Path Sum13treedfs
113Path Sum II22treedfs
114Flatten Binary Tree to Linked List33treerecursion + stack
115Distinct Subsequences42stringdp
116Populating Next Right Pointers in Each Node33treedfs
117Populating Next Right Pointers in Each Node II42treedfs
118Pascal‘s Triangle21array 
119Pascal‘s Triangle II21array 
120Triangle31arraydp
121Best Time to Buy and Sell Stock21arraydp
122Best Time to Buy and Sell Stock II31arraygreedy
123Best Time to Buy and Sell Stock III41arraydp
124Binary Tree Maximum Path Sum42treedfs
125Valid Palindrome25stringtwo pointers
126Word Ladder II11  
127Word Ladder35graphbfs + shortest path
128Longest Consecutive Sequence43array 
129Sum Root to Leaf Numbers24treedfs
130Surrounded Regions43arraybfs + dfs
131Palindrome Partitioning34stringdfs
132Palindrome Partitioning II43stringdp

LeetCode 刷题顺序表