1 |
Two Sum |
C++ |
Two Pointers |
2 |
Add Two Numbers |
C++ |
Linked List |
3 |
Longest Substring Without Repeating Characters |
C++ |
Hash Table |
4 |
Median of Two Sorted Arrays |
C++ |
Binary Search |
5 |
Longest Palindromic Substring |
C++ |
Two Pointers |
8 |
String to Integer (atoi) |
C++ |
String |
9 |
Palindrome Number |
C++ |
Math |
11 |
Container With Most Water |
C++ |
Two Pointers |
15 |
3Sum |
C++ |
Two Pointers |
17 |
Letter Combinations of a Phone Number |
C++ |
Backtracking |
18 |
4Sum |
C++ |
Two Pointers |
19 |
Remove Nth Node From End of List |
C++ |
Two Pointers |
20 |
Valid Parentheses |
C++ |
Stack |
21 |
Merge Two Sorted Lists |
C++ |
Linked List |
22 |
Generate Parentheses |
C++ |
Backtracking |
23 |
Merge k Sorted Lists |
C++ |
Divide and Conquer |
24 |
Swap Nodes in Pairs |
C++ |
Linked List |
26 |
Remove Duplicates from Sorted Array |
C++ |
Array |
27 |
Remove Element |
C++ |
Array |
28 |
Implement strStr() |
C++ |
String |
31 |
Next Permutation |
C++ |
Array |
33 |
Search in Rotated Sorted Array |
C++ |
Binary Search |
34 |
Search for a Range |
C++ |
Binary Search |
38 |
Count and Say |
C++ |
String |
39 |
Combination Sum |
C++ |
Backtracking |
40 |
Combination Sum II |
C++ |
Backtracking |
41 |
First Missing Positive |
C++ |
Array |
42 |
Trapping Rain Water |
C++ |
Two Pointers |
43 |
Multiply Strings |
C++ |
Math |
46 |
Permutations |
C++ |
Backtracking |
47 |
Permutations II |
C++ |
Backtracking |
48 |
Rotate Image |
C++ |
Array |
49 |
Group Anagrams |
C++ |
Hash Table |
50 |
Pow(x, n) |
C++ |
Binary Search |
53 |
Maximum Subarray |
C++ |
Dynamic Programming |
54 |
Spiral Matrix |
C++ |
Array |
56 |
Merge Intervals |
C++ |
Array |
58 |
Length of Last Word |
C++ |
String |
61 |
Rotate List |
C++ |
Linked List |
62 |
Unique Paths |
C++ |
Dynamic Programming |
63 |
Unique Paths II |
C++ |
Dynamic Programming |
64 |
Minimum Path Sum |
C++ |
Dynamic Programming |
67 |
Add Binary |
C++ |
String |
69 |
Sqrt(x) |
C++ |
Binary Search |
70 |
Climbing Stairs |
C++ |
Dynamic Programming |
73 |
Set Matrix Zeroes |
C++ |
Array |
74 |
Search a 2D Matrix |
C++ |
Binary Search |
75 |
Sort Colors |
C++ |
Two Pointers |
77 |
Combinations |
C++ |
Backtracking |
78 |
Subsets |
C++ |
Backtracking |
79 |
Word Search |
C++ |
Backtracking |
80 |
Remove Duplicates from Sorted Array II |
C++ |
Math |
82 |
Remove Duplicates from Sorted List II |
C++ |
Linked List |
83 |
Remove Duplicates from Sorted List |
C++ |
Linked List |
84 |
Largest Rectangle in Histogram |
C++ |
Stack |
85 |
Maximal Rectangle |
C++ |
Stack |
86 |
Partition List |
C++ |
Linked List |
90 |
Subsets II |
C++ |
Backtracking |
92 |
Reverse Linked List II |
C++ |
Linked List |
93 |
Restore IP Addresses |
C++ |
String |
94 |
Binary Tree Inorder Traversal |
C++ |
Tree |
96 |
Unique Binary Search Trees |
C++ |
Dynamic Programming |
97 |
Interleaving String |
C++ |
Dynamic Programming |
98 |
Validate Binary Search Tree |
C++ |
Tree |
99 |
Recover Binary Search Tree |
C++ |
Tree |
100 |
Same Tree |
C++ |
Depth-first Search |
101 |
Symmetric Tree |
C++ |
Tree |
102 |
Binary Tree Level Order Traversal |
C++ |
Breadth-first Search |
103 |
Binary Tree Zigzag Level Order Traversal |
C++ |
Breadth-first Search |
104 |
Maximum Depth of Binary Tree |
C++ |
Depth-first Search |
105 |
Construct BT from Preorder and Inorder Traversal |
C++ |
Depth-first Search |
108 |
Convert Sorted Array to Binary Search Tree |
C++ |
Tree |
109 |
Convert Sorted List to Binary Search Tree |
C++ |
Tree |
110 |
Balanced Binary Tree |
C++ |
Depth-first Search |
111 |
Minimum Depth of Binary Tree |
C++ |
Depth-first Search |
112 |
Path Sum |
C++ |
Depth-first Search |
113 |
Path Sum II |
C++ |
Depth-first Search |
114 |
Flatten Binary Tree to Linked List |
C++ |
Depth-first Search |
118 |
Pascal's Triangle |
C++ |
Array |
119 |
Pascal's Triangle II |
C++ |
Array |
121 |
Best Time to Buy and Sell Stock |
C++ |
Dynamic Programming |
122 |
Best Time to Buy and Sell Stock II |
C++ |
Dynamic Programming |
123 |
Best Time to Buy and Sell Stock III |
C++ |
Dynamic Programming |
125 |
Valid Palindrome |
C++ |
Two Pointers |
128 |
Longest Consecutive Sequence |
C++ |
Array |
129 |
Sum Root to Leaf Numbers |
C++ |
Depth-first Search |
130 |
Surrounded Regions |
C++ |
Breadth-first Search |
131 |
Palindrome Partitioning |
C++ |
Backtracking |
132 |
Palindrome Partitioning II |
C++ |
Backtracking |
136 |
Single Number |
C++ |
Bit Manipulation |
137 |
Single Number II |
C++ |
Bit Manipulation |
139 |
Word Break |
C++ |
Dynamic Programming |
141 |
Linked List Cycle |
C++ |
Two Pointers |
142 |
Linked List Cycle II |
C++ |
Two Pointers |
143 |
Reorder List |
C++ |
Linked List |
144 |
Binary Tree Preorder Traversal |
C++ |
Tree |
145 |
Binary Tree Postorder Traversal |
C++ |
Tree |
147 |
Insertion Sort List |
C++ |
Linked List |
148 |
Sort List |
C++ |
Linked List |
151 |
Reverse Words in a String |
C++ |
String |
152 |
Maximum Product Subarray |
C++ |
Dynamic Programming |
153 |
Find Minimum in Rotated Sorted Array |
C++ |
Binary Search |
154 |
Find Minimum in Rotated Sorted Array II |
C++ |
Binary Search |
155 |
Min Stack |
C++ |
Stack |
160 |
Intersection of Two Linked Lists |
C++ |
Linked List |
164 |
Maximum Gap |
C++ |
Sort |
167 |
Two Sum II - Input array is sorted |
C++ |
Two Pointers |
169 |
Majority Element |
C++ |
Array |
179 |
Largest Number |
C++ |
Sort |
191 |
Number of 1 Bits |
C++ |
Bit Manipulation |
199 |
Binary Tree Right Side View |
C++ |
Breadth-first Search |
200 |
Number of Islands |
C++ |
Depth-first Search |
203 |
Remove Linked List Elements |
C++ |
Linked List |
204 |
Count Primes |
C++ |
Math |
206 |
Reverse Linked List |
C++ |
Linked List |
207 |
Course Schedule |
C++ |
Breadth-first Search |
210 |
Course Schedule II |
C++ |
Breadth-first Search |
215 |
Kth Largest Element in an Array |
C++ |
Divide and Conquer |
216 |
Combination Sum III |
C++ |
Backtracking |
221 |
Maximal Square |
C++ |
Dynamic Programming |
225 |
Implement Stack using Queues |
C++ |
Stack |
230 |
Kth Smallest Element in a BST |
C++ |
Tree |
232 |
Implement Queue using Stacks |
C++ |
Stack |
234 |
Palindrome Linked List |
C++ |
Linked List |
235 |
Lowest Common Ancestor of BST |
C++ |
Tree |
236 |
Lowest Common Ancestor of a Binary Tree |
C++ |
Tree |
239 |
Sliding Window Maximum |
C++ |
Heap |
242 |
Valid Anagram |
C++ |
Hash Table |
257 |
Binary Tree Paths |
C++ |
Tree |
260 |
Single Number III |
C++ |
Bit Manipulation |
263 |
Ugly Number |
C++ |
Math |
264 |
Ugly Number II |
C++ |
Math |
268 |
Missing Number |
C++ |
Bit Manipulation |
279 |
Perfect Squares |
C++ |
Dynamic Programming |
283 |
Move Zeroes |
C++ |
Two Pointers |
290 |
Word Pattern |
C++ |
Hash Table |
295 |
Find Median from Data Stream |
C++ |
Heap |
300 |
Longest Increasing Subsequence |
C++ |
Dynamic Programming |
313 |
Super Ugly Number |
C++ |
Math |
322 |
Coin Change |
C++ |
Dynamic Programming |
329 |
Longest Increasing Path in a Matrix |
C++ |
Depth-first Search |
343 |
Integer Break |
C++ |
Dynamic Programming |
344 |
Reverse String |
C++ |
Two Pointers |
349 |
Intersection of Two Arrays |
C++ |
Hash Table |
350 |
Intersection of Two Arrays II |
C++ |
Hash Table |
371 |
Sum of Two Integers |
C++ |
Math |
387 |
First Unique Character in a String |
C++ |
Hash Table |
389 |
Find the Difference |
C++ |
Hash Table |
392 |
Is Subsequence |
C++ |
String |
404 |
Sum of Left Leaves |
C++ |
Tree |
409 |
Longest Palindrome |
C++ |
Hash Table |
415 |
Add Strings |
C++ |
Math |
416 |
Partition Equal Subset Sum |
C++ |
Dynamic Programming |
485 |
Max Consecutive Ones |
C++ |
Array |
542 |
01 Matrix |
C++ |
Breadth-first Search |