1 |
Two Sum |
Easy |
Two Sum |
|
2 |
Add Two Numbers |
Medium |
Add Two Numbers |
|
3 |
Longest Substring Without Repeating Characters |
Medium |
Longest Substring Without Repeating Characters |
|
4 |
Median of Two Sorted Arrays |
Hard |
Median of Two Sorted Arrays |
Binary Search * |
5 |
Longest Palindromic Substring |
Medium |
Longest Palindromic Substring |
dp & Manacher’s Algorithm * |
6 |
ZigZag Conversion |
Medium |
ZigZag Conversion |
|
7 |
Reverse Integer |
Easy |
Reverse Integer |
|
8 |
String to Integer (atoi) |
Medium |
String to Integer (atoi) |
|
9 |
Palindrome Number |
Easy |
Palindrome Number |
|
10 |
Regular Expression Matching |
Hard |
Regular Expression Matching |
dp ** |
11 |
Container With Most Water |
Medium |
Container With Most Water |
|
12 |
Integer to Roman |
Medium |
Integer to Roman |
|
13 |
Roman to Integer |
Easy |
Roman to Integer |
|
14 |
Longest Common Prefix |
Easy |
Longest Common Prefix |
|
15 |
3Sum |
Medium |
3Sum |
|
16 |
3Sum Closest |
Medium |
3Sum Closest |
|
17 |
Letter Combinations of a Phone Number |
Medium |
Letter Combinations of a Phone Number |
|
18 |
4Sum |
Medium |
4Sum |
|
19 |
Remove Nth Node From End of List |
Medium |
Remove Nth Node From End of List |
|
20 |
Valid Parentheses |
Easy |
Valid Parentheses |
|
21 |
Merge Two Sorted Lists |
Easy |
Merge Two Sorted Lists |
|
22 |
Generate Parentheses |
Medium |
Generate Parentheses |
|
23 |
Merge k Sorted Lists |
Hard |
Merge k Sorted Lists |
Divide Conquer & Heap Sort |
24 |
Swap Nodes in Pairs |
Medium |
Swap Nodes in Pairs |
|
25 |
Reverse Nodes in k-Group |
Hard |
Reverse Nodes in k-Group |
Reverse List |
26 |
Remove Duplicates from Sorted Array |
Easy |
Remove Duplicates from Sorted Array |
|
27 |
Remove Element |
Easy |
Remove Element |
|
28 |
Implement strStr() |
Easy |
Implement strStr() |
KMP Algorithm * |
29 |
Divide Two Integers |
Medium |
Divide Two Integers |
|
30 |
Substring with Concatenation of All Words |
Hard |
Substring with Concatenation of All Words |
|
31 |
Next Permutation |
Medium |
Next Permutation |
|
32 |
Longest Valid Parentheses |
Hard |
Longest Valid Parentheses |
DP/Stack * |
33 |
Search in Rotated Sorted Array |
Medium |
Search in Rotated Sorted Array |
|
34 |
Find First and Last Position of Element in Sorted Array |
Medium |
Find First and Last Position of Element in Sorted Array |
|
35 |
Search Insert Position |
Easy |
Search Insert Position |
|
36 |
Valid Sudoku |
Medium |
Valid Sudoku |
|
37 |
Sudoku Solver |
Hard |
Sudoku Solver |
Backtracking * |
38 |
Count And Say |
Easy |
Count And Say |
|
39 |
Combination Sum |
Medium |
Combination Sum |
backtracing |
40 |
Combination Sum II |
Medium |
Combination Sum II |
backtracing |
41 |
First Missing Positive |
Hard |
First Missing Positive |
Trick method |
42 |
Trapping Rain Water |
Hard |
Trapping Rain Water |
Dp/Stack/Two Pointer |
43 |
Multiply Strings |
Medium |
Multiply Strings |
|
44 |
Wildcard Matching |
Hard |
Wildcard Matching |
DP* |
45 |
Jump Game II |
Hard |
Jump Game II |
|
46 |
Permutations |
Medium |
Permutations |
|
47 |
Permutations II |
Medium |
Permutations II |
|
48 |
Rotate Image |
Medium |
Rotate Image |
|
49 |
Group Anagrams |
Medium |
Group Anagrams |
|
50 |
Pow(x, n) |
Medium |
Pow(x, n) |
|
53 |
Maximum Subarray |
Easy |
Maximum Subarray |
Kadane Algorithm * |
56 |
Merge Intervals |
Medium |
Merge Intervals |
|
57 |
Insert Interval |
Hard |
Insert Interval |
|
58 |
Length of Last Word |
Easy |
Length of Last Word |
|
66 |
Plus One |
Easy |
Plus One |
|
67 |
Add Binary |
Easy |
Add Binary |
|
69 |
Sqrt(x) |
Easy |
Sqrt(x) |
|
70 |
Climbing Stairs |
Easy |
Climbing Stairs |
|
71 |
Simplify Path |
Medium |
Simplify Path |
dp |
72 |
Edit Distance |
Hard |
Edit Distance |
|
77 |
Combinations |
Medium |
Combinations |
backtracing |
83 |
Remove Duplicates from Sorted List |
Easy |
Remove Duplicates from Sorted List |
|
88 |
Merge Sorted Array |
Easy |
Merge Sorted Array |
|
94 |
Binary Tree Inorder Traversal |
Medium |
Binary Tree Inorder Traversal |
|
100 |
Same Tree |
Easy |
Same Tree |
|
101 |
Symmetric Tree |
Easy |
Symmetric Tree |
* Binary-Tree Traverse |
102 |
Binary Tree Level Order Traversal |
Medium |
Binary Tree Level Order Traversal |
* Binary-Tree Traverse |
104 |
Maximum Depth of Binary Tree |
Easy |
Maximum Depth of Binary Tree |
* Binary-Tree Traverse |
105 |
Construct Binary Tree from Preorder and Inorder Traversal |
Medium |
Construct Binary Tree from Preorder and Inorder Traversal |
|
106 |
Construct Binary Tree from Inorder and Postorder Traversal |
Medium |
Construct Binary Tree from Inorder and Postorder Traversal |
|
107 |
Binary Tree Level Order Traversal II |
Easy |
Binary Tree Level Order Traversal II |
* Binary-Tree Traverse |
108 |
Convert Sorted Array to Binary Search Tree |
Easy |
Convert Sorted Array to Binary Search Tree |
* Binary-Tree Traverse |
112 |
Path Sum |
Easy |
Path Sum |
|
113 |
Path Sum II |
Medium |
Path Sum II |
|
121 |
Best Time to Buy and Sell Stock |
Easy |
Best Time to Buy and Sell Stock |
|
122 |
Best Time to Buy and Sell Stock |
Easy |
Best Time to Buy and Sell Stock |
|
123 |
Best Time to Buy and Sell Stock III |
Hard |
Best Time to Buy and Sell Stock III |
dp |
144 |
Binary Tree Preorder Traversal |
Medium |
Binary Tree Preorder Traversal |
|
145 |
Binary Tree Postorder Traversal |
Hard |
Binary Tree Postorder Traversal |
|
188 |
Best Time to Buy and Sell Stock IV |
Hard |
Best Time to Buy and Sell Stock IV |
dp |
198 |
House Robber |
Easy |
House Robber |
dp |
213 |
House Robber II |
Easy |
House Robber II |
dp |
216 |
Combination Sum III |
Medium |
Combination Sum III |
backtracing |
236 |
Lowest Common Ancestor of a Binary Tree |
Medium |
Lowest Common Ancestor of a Binary Tree |
|
279 |
Perfect Squares |
Medium |
Perfect Squares |
dp |
287 |
Find the Duplicate Number |
Medium |
Find the Duplicate Number |
fast-slow-pointer |
300 |
Longest Increasing Subsequence |
Medium |
Longest Increasing Subsequence |
dp |
309 |
Best Time to Buy and Sell Stock with Cooldown |
Medium |
Best Time to Buy and Sell Stock with Cooldown |
dp |
337 |
House Robber III |
Medium |
House Robber III |
dp |
373 |
Find K Pairs with Smallest Sums |
Medium |
Find K Pairs with Smallest Sums |
|
377 |
Combination Sum IV |
Medium |
Combination Sum IV |
dp |
378 |
Kth Smallest Element in a Sorted Matrix |
Medium |
Kth Smallest Element in a Sorted Matrix |
|
407 |
Trapping Rain Water II |
Hard |
Trapping Rain Water II |
|
437 |
Path Sum III |
Easy |
Path Sum III |
|
442 |
Find All Duplicates in an Array |
Medium |
Find All Duplicates in an Array |
|
448 |
Find All Numbers Disappeared in an Array |
Easy |
Find All Numbers Disappeared in an Array |
|
468 |
Validate IP Address |
Medium |
Validate IP Address |
|
538 |
Convert BST to Greater Tree |
Easy |
Convert BST to Greater Tree |
|
583 |
Delete Operation for Two Strings |
Medium |
Delete Operation for Two Strings |
dp |
645 |
Set Mismatch |
Easy |
Set Mismatch |
|
650 |
2 Keys Keyboard |
Medium |
2 Keys Keyboard |
dp |
669 |
Trim a Binary Search Tree |
Easy |
Trim a Binary Search Tree |
|
671 |
Second Minimum Node In a Binary Tree |
Easy |
Second Minimum Node In a Binary Tree |
|
687 |
Longest Univalue Path |
Easy |
Longest Univalue Path |
|
714 |
Best Time to Buy and Sell Stock with Transaction Fee |
Medium |
Best Time to Buy and Sell Stock with Transaction Fee |
dp |
873 |
Length of Longest Fibonacci Subsequence |
Medium |
Length of Longest Fibonacci Subsequence |
dp |
953 |
Verifying an Alien Dictionary |
Easy |
Verifying an Alien Dictionary |
|
1027 |
Longest Arithmetic Sequence |
Medium |
Longest Arithmetic Sequence |
dp |