1 |
Two Sum |
Hash Table |
2 |
Add Two Numbers |
Linked List |
3 |
Longest Substring Without Repeating Characters |
String |
4 |
Median of Two Sorted Arrays |
Array |
5 |
Longest Palindromic Substring |
String |
6 |
ZigZag Conversion |
String |
7 |
Reverse Integer |
Math |
8 |
String to Integer |
Math |
9 |
Palindrome Number |
Math |
10 |
Regular Expression Matching |
String |
11 |
Container With Most Water |
Two Pointers |
14 |
Longest Common Prefix |
String |
15 |
3Sum |
Two Pointers |
16 |
3Sum Closet |
Two Pointers |
17 |
Letter Combinations of a Phone Number |
BackTracking & DFS & BFS |
18 |
4Sum |
Two Pointers |
19 |
Remove Nth Node From End of List |
Linked List |
20 |
Valid Parentheses |
Stack & Queue |
21 |
Merge Two Sorted Lists |
Linked List |
22 |
Generate Parentheses |
BackTracking & DFS & BFS |
23 |
Merge k Sorted Lists |
Linked List |
24 |
Swap Nodes in Pairs |
Linked List |
25 |
Reverse_Nodes_in_k Group |
Linked List |
26 |
Remove Duplicates from Sorted Array |
Two Pointers |
27 |
Remove Element |
Array |
28 |
Implement strStr() |
String |
29 |
Divide Two Integers |
Math |
31 |
Next Permutation |
Array |
33 |
Search in Rotated Sorted Array |
Binary Search |
34 |
Find First and Last Position of Element in Sorted Array |
Array |
35 |
Search Insert Position |
Binary Search |
37 |
Sudoku Solver |
BackTracking & DFS & BFS |
39 |
Combination Sum |
BackTracking & DFS & BFS |
40 |
Combination Sum II |
BackTracking & DFS & BFS |
41 |
First Missing Positive |
Array |
42 |
Trapping Rain Water |
Stack & Queue |
43 |
Multiply Strings |
Math |
45 |
3 Jump Game II |
Greedy |
46 |
Permutations |
BackTracking & DFS & BFS |
47 |
Permutations II |
BackTracking & DFS & BFS |
48 |
Rotate Image |
Array |
49 |
Group Anagrams |
Sort |
50 |
Pow(x, n) |
Math |
51 |
N Queens |
BackTracking & DFS & BFS |
52 |
N Queens II |
BackTracking & DFS & BFS |
53 |
Maximum Subarray |
Sliding Window |
54 |
Spiral Matrix |
Array |
55 |
Jump Game |
Greedy |
56 |
Merge Intervals |
Sort |
59 |
Spiral Matrix II |
Array |
61 |
Rotate List |
Linked List |
62 |
Unique Paths |
Dynamic Programming |
63 |
Unique Paths II |
Dynamic Programming |
64 |
Minimum Path Sum |
Dynamic Programming |
65 |
Valid Number |
Math |
67 |
Add Binary |
Math |
69 |
Sqrt(x) |
Math |
70 |
Climbing Stairs |
Dynamic Programming |
72 |
Edit Distance |
Dynamic Programming |
73 |
Set Matrix Zeroes |
Array |
74 |
Search a 2D Matrix |
Array |
75 |
Sort Colors |
Two Pointers |
76 |
Minimum Window Substring |
Sliding Window |
77 |
Combinations |
BackTracking & DFS & BFS |
78 |
Subsets |
BackTracking & DFS & BFS |
79 |
Word Search |
BackTracking & DFS & BFS |
80 |
Remove Duplicates from Sorted Array II |
Two Pointers |
82 |
Remove Duplicates from Sorted List II |
Linked List |
83 |
Remove Duplicates from Sorted List |
Linked List |
84 |
Largest Rectangle in Histogram |
Stack & Queue |
85 |
Maximal Rectangle |
Stack & Queue |
88 |
MergeSortedArray |
Array |
90 |
Subsets II |
BackTracking & DFS & BFS |
91 |
Decode Ways |
Dynamic Programming |
92 |
Reverse Linked List II |
Linked List |
94 |
Binary Tree Inorder Traversal |
Tree |
95 |
Unique Binary Search Trees II |
Tree |
96 |
Unique Binary Search Trees |
Tree |
98 |
Validate Binary Search Tree |
Tree |
100 |
Same Tree |
Tree |
101 |
Symmetric Tree |
Tree |
102 |
Binary Tree Level Order Traversal |
Tree |
103 |
Binary Tree Zigzag Level Order Traversal |
Tree |
104 |
Maximum Depth of Binary Tree |
Tree |
105 |
Construct Binary Tree from Preorder and Inorder Traversal |
Tree |
106 |
Construct Binary Tree from Inorder and Postorder Traversal |
Tree |
107 |
Binary Tree Level Order Traversal II |
Tree |
110 |
Balanced Binary Tree |
Tree |
111 |
Minimum Depth of Binary Tree |
Tree |
112 |
Path Sum |
Tree |
113 |
Path Sum II |
Tree |
115 |
Min Stack |
Stack & Queue |
118 |
Pascal's Triangle |
Array |
119 |
Pascal's Triangle II |
Array |
121 |
Best Time to Buy and Sell Stock |
Dynamic Programming |
122 |
Best Time to Buy and Sell Stock II |
Dynamic Programming |
125 |
Valid Palindrome |
String |
128 |
Longest Consecutive Sequence |
Disjoint Set |
130 |
Surrounded Regions |
BackTracking & DFS & BFS |
134 |
Gas Station |
Greedy |
136 |
Single Number |
Bit Operation |
137 |
Single Number II |
Bit Operation |
138 |
Copy List with Random Pointer |
Linked List |
141 |
Linked List Cycle |
Linked List |
142 |
Linked List Cycle II |
Linked List |
144 |
Binary Tree Preorder Traversal |
Tree |
145 |
Binary Tree Postorder Traversal |
Tree |
148 |
Sort List |
Sort |
150 |
Evaluate Reverse Polish Notation |
Stack & Queue |
151 |
Reverse Words in a String |
String |
152 |
Maximum Product Subarray |
Dynamic Programming |
153 |
Find_Minimum in Rotated Sorted Array |
Binary Search |
154 |
Find Minimum in Rotated Sorted Array II |
Binary Search |
160 |
Intersection of Two Linked Lists |
Linked List |
164 |
Maximum Gap |
Sort |
167 |
Two Sum II Input array is sorted |
Two Pointers |
168 |
Excel Sheet Column Title |
Math |
169 |
Majority_Element |
Hash Table |
171 |
Excel Sheet Column Number |
Math |
172 |
Factorial Trailing Zeroes |
Math |
179 |
Largest Number |
Sort |
191 |
Number of 1 Bits |
Bit Operation |
198 |
House Robber |
Dynamic Programming |
200 |
Number of Islands |
BackTracking & DFS & BFS |
201 |
Bitwise AND of Numbers Range |
Bit Operation |
202 |
Happy Number |
Math |
203 |
Remove Linked List Elements |
Linked List |
204 |
Count Primes |
Math |
206 |
Reverse Linked List |
Linked List |
213 |
House Robber II |
Dynamic Programming |
215 |
Kth Largest Element in an Array |
Heap & Priority_queue |
217 |
Contains Duplicate |
Hash Table |
219 |
Contains Duplicate II |
Hash Table |
220 |
Contains Duplicate III |
Hash Table |
221 |
Maximal Square |
Dynamic Programming |
225 |
Implement Stack using Queues |
Stack & Queue |
226 |
Invert Binary Tree |
Tree |
231 |
Power of Two |
Math |
232 |
Implement Queue using Stacks |
Stack & Queue |
233 |
Number of Digit One |
Math |
234 |
Palindrome Linked List |
Linked List |
236 |
Lowest Common Ancestor of a Binary Tree |
Tree |
238 |
Product of Array Except Self |
Array |
239 |
Sliding Window Maximum |
Sliding Window |
240 |
Search a 2D Matrix II |
Array |
242 |
Valid Anagram |
Hash Table |
256 |
Paint House |
Dynamic Programming |
258 |
Add Digits |
Math |
260 |
Single Number III |
Bit Operation |
263 |
Ugly Number |
Math |
264 |
Ugly Number II |
Math |
268 |
Missing Number |
Math |
276 |
Paint Fence |
Dynamic Programming |
283 |
Move Zeroes |
Array |
289 |
Game of Life |
Bit Operation |
290 |
Word Pattern |
Hash Table |
292 |
Nim Game |
Math |
295 |
Find Median from Data Stream |
Heap & Priority_queue |
300 |
Longest Increasing Subsequence |
Dynamic Programming |
312 |
Burst Balloons |
Dynamic Programming |
322 |
Coin Change |
Dynamic Programming |
326 |
Power of Three |
Math |
342 |
Power of Four |
Math |
343 |
Integer Break |
Dynamic Programming |
344 |
Reverse String |
String |
347 |
Top-K Frequent Elements |
Heap & Priority_queue |
349 |
Intersection of Two Arrays |
Hash Table |
354 |
Russian Doll Envelopes |
Dynamic Programming |
355 |
Design Twitter |
Design |
365 |
Water and Jug Problem |
Math |
367 |
Valid Perfect Square |
Math |
371 |
Sum of Two Integers |
Math |
372 |
Super Pow |
Math |
383 |
Ransom Note |
Hash Table |
389 |
Find the Difference |
Bit Operation |
392 |
Is Subsequence |
Two Pointer |
398 |
Random Pick Index |
Reservoir Sampling |
400 |
Nth Digit |
Math |
409 |
Longest Palindrome |
String |
415 |
Add Strings |
Math |
416 |
Partition Equal Subset Sum |
Dynamic Programming |
424 |
Longest Repeating Character Replacement |
Sliding Window |
438 |
Find All Anagrams in a String |
Sliding Window |
445 |
Add Two Numbers II |
Linked List |
448 |
Find All Numbers Disappeared in an Array |
Array |
455 |
Assign Cookies |
Greedy |
459 |
Repeated Substring Pattern |
String |
460 |
LFU Cache |
Hash Table |
461 |
Hamming Distance |
Bit Operation |
463 |
Island Perimeter |
Array |
466 |
Count The Repetitions |
Dynamic Programming |
470 |
Implement Rand10() Using Rand7() |
Random |
485 |
Max Consecutive Ones |
Array |
486 |
Predict the Winner |
Dynamic Programming |
491 |
Increasing Subsequences |
BackTracking & DFS & BFS |
509 |
Fibonacci Number |
Dynamic Programming |
518 |
Coin Change 2 |
Dynamic Programming |
523 |
Continuous Subarray Sum |
Hash Table |
540 |
Single Element in a Sorted Array |
Bit Operation |
541 |
Reverse String II |
String |
542 |
01 Matrix |
BackTracking & DFS & BFS |
543 |
Diameter of Binary Tree |
Tree |
547 |
Friend Circles |
Disjoint Set |
557 |
Reverse Words in a String III |
String |
560 |
Subarray Sum Equals K |
Hash Table |
561 |
Array Partition I |
Sort |
572 |
Subtree of Another Tree |
Tree |
617 |
Merge Two Binary Trees |
Tree |
628 |
Maximum Product of Three Numbers |
Math |
637 |
Average of Levels in Binary Tree |
Tree |
643 |
Maximum Average Subarray I |
Sliding Window |
645 |
SetMismatch |
Array |
647 |
Palindromic Substrings |
String |
657 |
Robot Return to Origin |
String |
662 |
Maximum Width of Binary Tree |
Tree |
692 |
Top K Frequent Words |
Heap & Priority_queue |
695 |
Max Area of Island |
BackTracking & DFS & BFS |
704 |
Binary Search |
Binary Search |
724 |
Find Pivot Index |
Array |
752 |
Open the Lock |
BackTracking & DFS & BFS |
766 |
Toeplitz Matrix |
Array |
836 |
Rectangle Overlap |
Math |
844 |
Backspace String Compare |
Stack & Queue |
845 |
Longest Mountain in Array |
Two Pointers |
860 |
Lemonade Change |
Greedy |
876 |
Middle of the LinkedList |
Linked List |
887 |
Super Egg Drop |
Dynamic Programming |
888 |
Fair Candy Swap |
Hash Table |
892 |
Surface Area of 3D Shapes |
Math |
905 |
Sort Array By Parity |
Array |
912 |
Sort an Array |
Sort |
914 |
X of a Kind in a Deck of Cards |
Math |
921 |
Minimum Add to Make Parentheses Valid |
Stack & Queue |
922 |
Sort Array By Parity II |
Array |
925 |
Long Pressed Name |
Two Pointers |
945 |
Minimum Increment to Make Array Unique |
Array |
946 |
Validate Stack Sequences |
Stack & Queue |
989 |
Add to Array Form of Integer |
Array |
994 |
Rotting Oranges |
BackTracking & DFS & BFS |
999 |
Available Captures for Rook |
BackTracking & DFS & BFS |
1000 |
Minimum Cost to Merge Stones |
Dynamic Programming |
1002 |
Find Common Characters |
String |
1004 |
Max Consecutive Ones III |
Sliding Window |
1013 |
Partition Array Into Three Parts With Equal Sum |
Array |
1018 |
Binary Prefix Divisible By 5 |
Bit Operation |
1051 |
Height Checker |
Sort |
1071 |
Greatest Common Divisor of Strings |
Math |
1128 |
Number of Equivalent Domino Pairs |
Hash Table |
1130 |
Minimum Cost Tree From Leaf Values |
Dynamic Programming |
1143 |
Longest Common Subsequence |
Dynamic Programming |
1160 |
Find Words That Can Be Formed by Characters |
Hash Table |
1162 |
As Far from Land as Possible |
BackTracking & DFS & BFS |
1167 |
Minimum Cost to Connect Sticks |
Heap & Priority_queue |
1200 |
Minimum Absolute Difference |
Array |
1207 |
Unique Number of Occurrences |
Hash Table |
1232 |
Check If It Is a Straight Line |
Math |
1248 |
Count Number of Nice Subarrays |
Sliding Window |
1277 |
Count Square Submatrices with All Ones |
Dynamic Programming |
1353 |
Maximum Number of Events That Can Be Attended |
Heap & Priority_queue |
1423 |
Maximum Points You Can Obtain from Cards |
Sliding Window |
1477 |
Find Two Non overlapping Sub arrays Each With Target Sum |
Dynamic Programming |
1486 |
XOR Operation in an Array |
Bit Operation |
1544 |
Make The String Great |
Stack & Queue |
1545 |
Find Kth Bit in Nth Binary String |
String |
1546 |
Maximum Number of Non Overlapping Subarrays With Sum Equals Target |
Dynamic Programming |
1547 |
Minimum Cost to Cut a Stick |
Dynamic Programming |
1684 |
Count the Number of Consistent Strings |
String |
1685 |
Sum of Absolute Differences in a Sorted Array |
Prefix Sum |
1686 |
Stone Game VI |
Greedy |
1688 |
Count the Number of Consistent Strings |
Math |
1689 |
Partitioning Into Minimum Number Of Deci-Binary Numbers |
Greedy |
1690 |
Stone Game VII |
Dynamic Programming |
1694 |
Reformat Phone Number |
String |