1 |
A + B Problem |
leetcode_372 |
|
2 |
Trailing Zeros |
leetcode_172 |
|
3 |
Digit Counts |
Python |
|
4 |
Ugly Number II |
leetcode_264 |
|
5 |
Kth Largest Element |
Python |
quick_select, heap |
6 |
Merge Two Sorted Arrays |
leetcode_88 |
|
7 |
Serialize and Deserialize Binary Tree |
leetcode_297 |
|
8 |
Rotate String |
leetcode_796 |
|
9 |
Fizz Buzz |
leetcode_412 |
|
10 |
String Permutation II |
Python |
backtracking |
11 |
Search Range in Binary Search Tree |
leetcode_938 |
|
12 |
Min Stack |
leetcode_155 |
|
13 |
Implement strStr() |
leetcode_28 |
|
14 |
First Position of Target |
leetcode_34 |
|
15 |
Permutations |
leetcode_46 |
|
16 |
Permutations II |
leetcode_47 |
|
17 |
Subsets |
leetcode_78 |
|
18 |
Subsets II |
leetcode_90 |
|
20 |
Dices Sum |
Python |
|
22 |
Flatten List |
leetcode_314 |
|
28 |
Search a 2D Matrix |
leetcode_74 |
|
31 |
Partition Array |
Python |
two_pointers |
33 |
N Queens |
leetcode_51 |
|
34 |
N Queens II |
leetcode_52 |
|
35 |
Reverse Linked List |
leetcode_206 |
|
36 |
Reverse Linked List II |
leetcode_92 |
|
38 |
Search a 2D Matrix II |
leetcode_240 |
|
40 |
Implement Queue by Two Stacks |
Python |
|
41 |
Maximum Subarray |
Python |
greedy, dp |
46 |
Majority Element |
leetcode_169 |
|
49 |
Sort Letters by Case |
Python |
|
50 |
Product of Array Exclude Itself |
leetcode_lcof_66 |
|
52 |
Next Permutation |
Python |
|
53 |
Reverse Words in a String |
leetcode_151 |
|
56 |
Two Sum |
leetcode_1 |
|
57 |
3Sum |
leetcode_15 |
|
58 |
4Sum |
leetcode_18 |
|
59 |
3Sum Closest |
leetcode_16 |
|
60 |
Search Insert Position |
leetcode_35 |
|
61 |
Search for a Range |
leetcode_34 |
|
62 |
Search in Rotated Sorted Array |
leetcode_33 |
|
63 |
Search in Rotated Sorted Array II |
leetcode_81 |
|
64 |
Merge Sorted Array |
leetcode_88 |
|
65 |
Median of Two Sorted Arrays |
leetcode_4 |
|
66 |
Binary Tree Preorder Traversal |
leetcode_144 |
|
67 |
Binary Tree Inorder Traversal |
leetcode_94 |
|
68 |
Binary Tree Postorder Traversal |
leetcode_145 |
|
69 |
Binary Tree Level Order Traversal |
leetcode_102 |
|
70 |
Binary Tree Level Order Traversal II |
leetcode_102 |
|
71 |
Binary Tree Zigzag Level Order Traversal |
leetcode_103 |
|
72 |
Construct Binary Tree from Inorder and Postorder Traversal |
leetcode_106 |
|
73 |
Construct Binary Tree from Preorder and Inorder Traversal |
leetcode_105 |
|
74 |
First Bad Version |
leetcode_278 |
|
75 |
Find Peak Element |
leetcode_825 |
|
76 |
Longest Increasing Subsequence |
Python |
ๆฅ้พๅๅจๆ่งๅ |
77 |
Longest Common Subsequence |
Python |
|
78 |
Longest Common Prefix |
leetcode_14 |
|
79 |
Longest Common Substring |
Python |
|
80 |
Median |
Python |
quick_select |
82 |
Single Number |
leetcode_136 |
|
83 |
Single Number II |
leetcode_137 |
|
84 |
Single Number III |
leetcode_260 |
|
86 |
Binary Search Tree Iterator |
Python |
|
88 |
Lowest Common Ancestor of a Binary Tree |
Python |
divide_and_conquer |
90 |
k Sum II |
Python |
|
92 |
Backpack |
Python |
|
93 |
Balanced Binary Tree |
Python |
divide_and_conquer |
94 |
Binary Tree Maximum Path Sum |
Python |
|
95 |
Validate Binary Search Tree |
Python |
|
96 |
Partition List |
leetcode_86 |
|
97 |
Maximum Depth of Binary Tree |
Python |
|
98 |
Sort List |
leetcode_148 |
|
100 |
Remove Duplicates from Sorted Array |
leetcode_26 |
|
102 |
Linked List Cycle |
leetcode_141 |
|
103 |
Linked List Cycle II |
leetcode_142 |
|
104 |
Merge k Sorted Lists |
leetcode_23 |
|
105 |
Copy List with Random Pointer |
Python |
|
106 |
Convert Sorted List to Binary Search Tree |
Python |
divide_and_conquer |
107 |
Word Break |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
109 |
Triangle |
leetcode_120 |
|
110 |
Minimum Path Sum |
Python |
|
112 |
Remove Duplicates from Sorted List |
C++ |
|
113 |
Remove Duplicates from Sorted List II |
C++ |
|
114 |
Unique Paths |
leetcode_62 |
|
115 |
Unique Paths II |
Python |
|
120 |
Word Ladder |
Python |
ๅๅBFS |
121 |
Word Ladder II |
Python |
BFS+DFS |
123 |
Word Search |
Python |
|
124 |
Longest Consecutive Sequence |
Python |
ๅนถๆฅ้ |
125 |
Backpack II |
Python |
|
127 |
Topological Sorting |
Python |
BFS, topological_sorting |
128 |
Hash Function |
Python |
|
129 |
Rehashing |
Python |
|
132 |
Word Search II |
Python |
ๅ็ผๆ |
134 |
LRU Cache |
Python |
double_linked_list, OrderedDict |
135 |
Combination Sum |
Python, Rust |
|
137 |
Clone Graph |
Python |
DFS, BFS |
138 |
Subarray Sum |
Python |
|
140 |
Fast Power |
leetcode_50 |
|
141 |
Sqrt(x) |
leetcode_69 |
|
142 |
O(1) Check Power of 2 |
leetcode_231 |
|
143 |
Sort Colors II |
Python |
quick_sort, counting_sort |
144 |
interleaving_positive_and_negative_numbers |
Python |
|
145 |
Lower case to Uppercase |
leetcode_709 |
|
147๐ |
Narcissistic Number |
Python |
|
148 |
Sort Colors |
Python |
three_pointers, partition_array |
149 |
Best Time to Buy and Sell Stock |
leetcode_121 |
|
150 |
Best Time to Buy and Sell Stock II |
leetcode_122 |
|
151 |
Best Time to Buy and Sell Stock III |
leetcode_123 |
|
152 |
Combinations |
leetcode_77 |
|
153 |
Combination Sum II |
Python, Rust |
|
154 |
Regular Expression Matching |
leetcode_10 |
|
155 |
Minimum Depth of Binary Tree |
leetcode_111 |
|
158 |
Valid Anagram |
leetcode_242 |
|
159 |
Find Minimum in Rotated Sorted Array |
leetcode_153 |
|
160 |
Find Minimum in Rotated Sorted Array II |
Python |
binary_search |
161 |
Rotate Image |
Rust |
|
162 |
Set Matrix Zeroes |
leetcode_73 |
|
165 |
Merge Two Sorted Lists |
leetcode_21 |
|
166 |
Nth to Last Node in List |
leetcode_19 |
|
167 |
Add Two Numbers |
leetcode_2 |
|
168 |
Burst Balloons |
Python |
|
171 |
Anagrams |
Python |
|
172 |
Remove Element |
leetcode_27 |
|
173 |
Insertion Sort List |
leetcode_147 |
|
174 |
Remove Nth Node From End of List |
leetcode_19 |
|
175 |
Invert Binary Tree |
leetcode_226 |
|
177 |
Convert Sorted Array to Binary Search Tree With Minimal Height |
Python |
divide_and_conquer |
181 |
Flip Bits |
leetcode_461 |
|
183 |
Wood Cut |
Python |
greedy |
187 |
Gas Station |
leetcode_134 |
|
190 |
Next Permutation II |
Python |
|
192 |
Wildcard Matching |
Python |
|
197 |
Permutation Index |
Python |
|
200 |
Longest Palindromic Substring |
leetcode_5 |
|
209 |
First Unique Character in a String |
leetcode_387 |
|
211 |
String Permutation |
Python |
|
235 |
Prime Factorization |
Python |
ๅ่งฃ่ดจๅ ๆฐ |
241๐ |
String to Integer (atoi) |
leetcode_8 |
|
249 |
Count of Smaller Number before itself |
Python |
sqrt_n |
254 |
Drop Eggs |
Python |
sqrt_n |
272๐ |
Climbing Stairs II |
Python |
|
298 |
Find Primes |
leetcode_204 |
|
309 |
Interleaved Array |
|
|
328 |
String Partition |
leetcode_763 |
|
334 |
Order Check |
leetcode_1051 |
|
363 |
Trapping Rain Water |
leetcode_42 |
|
366 |
Fibonacci |
leetcode_509 |
|
372 |
Delete Node in a Linked List |
leetcode_237 |
|
373 |
Partition Array by Odd and Even |
leetcode_905 |
|
374 |
Spiral Matrix |
leetcode_54 |
|
376 |
Binary Tree Path Sum |
Python |
DFS, backtracking |
380 |
Intersection of Two Linked Lists |
Python |
|
381 |
Spiral Matrix II |
leetcode_59 |
|
382๐ |
Triangle Count |
leetcode_611 |
|
383 |
Container With Most Water |
leetcode_11 |
|
384 |
Longest Substring Without Repeating Characters |
leetcode_3 |
|
386 |
Longest Substring with At Most K Distinct Characters |
Python |
|
388 |
Permutation Sequence |
Python |
|
389 |
Valid Sudoku |
leetcode_36 |
|
392 |
House Robber |
Python |
|
393 |
Best Time to Buy and Sell Stock IV |
Python |
|
397 |
Longest Continuous Increasing Subsequence |
Python |
|
400 |
Maximum Gap |
leetcode_164 |
|
406 |
Minimum Size Subarray Sum |
Python |
sliding_window |
407 |
Plus One |
leetcode_66 |
|
408 |
Add Binary |
leetcode_67 |
|
411 |
Gray Code |
leetcode_89 |
|
412 |
Candy |
leetcode_135 |
|
415 |
Valid Palindrome |
Python |
two_pointers |
417 |
Valid number |
leetcode_65 |
|
418 |
Integer to Roman |
leetcode_12 |
|
419 |
Roman to Integer |
leetcode_13 |
|
420 |
Count And Say |
leetcode_38 |
|
423 |
Valid Parentheses |
leetcode_20 |
|
425 |
Letter Combinations of a Phone Number |
leetcode_17 |
|
426 |
Restore IP Addresses |
leetcode_93 |
|
427 |
Generate Parentheses |
leetcode_22 |
|
428 |
Pow(x, n) |
leetcode_50 |
|
433 |
Number of Islands |
Python |
special_data_structure.union_find, DFS, BFS |
437 |
Copy Books |
Python |
dp, binary_search |
440๐ |
Backpack III |
Python |
|
443๐ |
Two Sum - Greater than target |
Python |
two_pointers |
447๐ |
Search in a Big Sorted Array |
Python |
binary_search_first, ๅๅขๆณ |
451 |
Swap Nodes in Pairs |
leetcode_24 |
|
452 |
Remove Linked List Elements |
leetcode_203 |
|
453 |
Flatten Binary Tree to Linked List |
Python |
|
457 |
Classical Binary Search |
Python |
binary_search |
458 |
Last Position of Target |
leetcode_34 |
|
460 |
Find K Closest Elements |
leetcode_658 |
|
461 |
Kth Smallest Numbers in Unsorted Array |
Python |
|
462 |
Total Occurrence of Target |
leetcode_34 |
|
464 |
Sort Integers II |
Python |
|
466 |
Count Linked List Nodes |
too_easy |
|
474๐ |
Lowest Common Ancestor II |
Python |
|
476 |
Stone Game(diff to leetcode) |
Python |
|
480 |
Binary Tree Paths |
Python |
DFS, backtracking |
486 |
Merge K Sorted Arrays |
Python |
|
488 |
Happy Number |
leetcode_202 |
|
491 |
Palindromic Number |
leetcode_9 |
|
492 |
Implement Queue by Linked List |
Python |
|
494 |
Implement Stack by Two Queues |
Python |
|
495 |
Implement Stack |
Python |
|
512 |
Decode Ways |
Python |
|
513 |
Perfect Squares |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
517 |
Ugly Number |
leetcode_263 |
|
521๐ |
Remove Duplicate Numbers in Array |
Python |
partition_array |
533๐ |
Two Sum - Closest to target |
Python |
two_sum |
534 |
House Robber II |
leetcode_213 |
|
535 |
House Robber III |
leetcode_337 |
|
539 |
Move Zeros |
leetcode_283 |
|
544 |
Top k Largest Numbers |
Python |
min_heap |
545 |
Top k Largest Numbers II |
Python |
min_heap |
547 |
Intersection of Two Arrays |
Python |
|
548 |
Intersection of Two Arrays II |
Python |
|
562 |
Backpack IV |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
564 |
Combination Sum IV |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
563 |
Backpack V |
Python |
|
577 |
Merge k Sorted Interval Lists |
Python |
|
578 |
Lowest Common Ancestor III |
Python |
|
582 |
Word Break II |
Python |
|
584 |
Drop Eggs II |
Rust |
dp |
585๐ |
Maximum Number in Mountain Sequence |
Python |
mountain_array, binary_search |
586๐ |
Sqrt(x) II |
leetcode_69 |
|
587๐ |
Two Sum - Unique pairs |
Python |
two_sum |
588 |
Partition Equal Subset Sum |
Python |
0-1่ๅ
้ฎ้ข |
594 |
Implement strStr() II |
Python |
kmp, Rabin-Karp(rolling_hash) |
596๐ |
Minimum Subtree |
Python |
divide_and_conquer |
600 |
Smallest Rectangle Enclosing Black Pixels |
Python |
|
603 |
Largest Divisible Subset |
Python |
|
606 |
Kth Largest Element II |
Python |
quick_select, quick_sort, heap |
607 |
Two Sum III - Data structure design |
Python |
two_pointers |
608 |
Two Sum II - Input array is sorted |
Python |
two_pointers |
609 |
Two Sum - Less than or equal to target |
Python |
two_pointers |
610 |
Two Sum - Difference equals to target |
Python |
two_pointers |
611๐ |
Knight Shortest Path |
Python |
bfs |
612๐ |
K Closest Points |
leetcode_973 |
|
615 |
Course Schedule |
Python |
BFS, topological_sorting |
616 |
Course Schedule II |
Python |
BFS, topological_sorting |
627 |
Longest Palindromic Combination |
Python |
greedy |
628 |
Maximum Subtree |
Python |
divide_and_conquer |
630๐ |
Knight Shortest Path II |
Python |
bfs |
633 |
Find the Duplicate Number |
Python |
ๅฟซๆ
ขๅๆ้ |
654 |
Sparse Matrix Multiplication |
leetcode_311 |
|
655 |
Add String |
C++ |
|
657 |
Insert Delete GetRandom O(1) |
Python |
|
661 |
Convert BST to Greater Tree |
Python |
|
667 |
Longest Palindromic Subsequence |
Python |
dp(greedy) |
668 |
Ones and Zeroes |
leetcode_474 |
|
669 |
Coin Change |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
683 |
Word Break III |
Python |
|
685 |
First Unique Number in Data Stream |
Python |
|
689 |
First Unique Number in Data Stream |
Python |
|
691 |
Recover Binary Search Tree |
Python |
|
701 |
Trim A Binary Search Tree |
Python |
|
702 |
Russian Doll Envelopes |
Python |
|
719 |
Calculate Maximum Value |
Python |
|
724 |
Minimum Partition |
Python |
0-1่ๅ
้ฎ้ข |
740 |
Coin Change 2 |
Python |
ๅฎๅ
จ่ๅ
้ฎ้ข |
741 |
Calculate Maximum Value II |
Python |
|
742 |
Self Dividing Numbers |
leetcode_728 |
|
749 |
John's backyard garden |
Python |
|
761 |
Smallest Subset |
Python |
|
769 |
Spiral Array |
leetcode_59 |
|
772 |
Group Anagrams |
leetcode_49 |
|
773 |
Valid Anagram |
leetcode_242 |
|
777 |
Valid Perfect Square |
leetcode_367 |
|
787 |
The Maze |
leetcode_490 |
|
793 |
Intersection of Arrays |
Python |
|
802 |
Soduku Solver |
Python |
|
813 |
Find Anagram Mappings |
leetcode_760 |
|
816 |
Traveling Salesman Problem |
Python |
|
828 |
Word Pattern |
Python |
|
829 |
Word Pattern II |
Python |
DFS |
835 |
Hamming Distance |
leetcode_461 |
|
839 |
Merge Two Sorted Interval Lists |
Python |
|
840 |
Range Sum Query - Mutable |
leetcode_307 |
|
841 |
String Replace |
Python |
|
845 |
Greatest Common Divisor |
Python |
|
859 |
Max Stack |
Python |
|
871 |
Minimum Factorization |
Python |
greedy |
880 |
Construct Binary Tree from String |
Python |
|
891 |
Valid Palindrome II |
Python |
two_pointers, greedy |
892 |
Alien Dictionary |
Python |
heapq, topological_sorting |
900 |
Closest Binary Search Tree Value |
Python |
|
901 |
Closest Binary Search Tree Value II |
Python |
|
902 |
Kth Smallest Element in a BST |
Python |
DFS, stack |
904 |
Plus One Linked List |
leetcode_369 |
|
916 |
Palindrome Permutation |
leetcode_266 |
|
943 |
Range Sum Query - Immutable |
leetcode_303 |
|
954 |
Insert Delete GetRandom O(1) - Duplicates allowed |
Python |
|
955 |
Implement Queue by Circular Array |
Python |
|
973 |
1-bit and 2-bit Characters |
leetcode_713 |
|
975 |
2 Keys Keyboard |
leetcode_650 |
|
976 |
4Sum II |
leetcode_454 |
|
982 |
Arithmetic Slices |
leetcode_413 |
|
995 |
Best Time ... Stock with Cooldown |
Python |
|
1000 |
Best Time ... Stock with ... Fee |
leetcode_714 |
|
1010 |
Max Increase to Keep City Skyline |
leetcode_807 |
|
1028 |
Rotated Digits |
leetcode_788 |
|
1038 |
Jewels and Stones |
leetcode_771 |
|
1054 |
Min Cost Climbing Stairs |
leetcode_746 |
|
1057 |
Network Delay Time |
leetcode_743 |
|
1079 |
Count Binary Substrings |
leetcode_696 |
|
1115 |
Average of Levels in Binary Tree |
leetcode_633 |
|
1137 |
Construct String from Binary Tree |
leetcode_606 |
|
1147 |
Work Plan |
Python |
|
1162 |
Merge Two Binary Trees |
Python |
|
1173 |
Reverse Words in a String III |
leetcode_567 |
|
1179๐ |
Friend Circles |
leetcode_547 |
|
1186 |
Encode and Decode TinyURL |
leetcode_535 |
|
1199 |
Perfect Number |
leetcode_507 |
|
1080 |
Max Area of Island |
leetcode_695 |
|
1138 |
Can Place Flowers |
leetcode_605 |
|
1196 |
Freedom Trail |
leetcode_514 |
|
1201 |
Next Greater Element II |
leetcode_503 |
|
1205 |
Diagonal Traverse |
leetcode_498 |
|
1208 |
Target Sum |
Python |
0-1่ๅ
้ฎ้ข |
1212 |
Max Consecutive Ones |
leetcode_485 |
|
1222 |
Validate IP Address |
leetcode_486 |
|
1225 |
Island Perimeter |
leetcode_463 |
|
1230 |
Assign Cookies |
leetcode_455 |
|
1235 |
Serialize and Deserialize BST |
leetcode_449 |
|
1246 |
Longest Repeating Character Replacement |
leetcode_426 |
|
1252 |
Queue Reconstruction by Height |
leetcode_406 |
|
1254 |
Sum of Left Leaves |
Python |
|
1266 |
Find The Difference |
leetcode_389 |
|
386 |
Lexicographical Numbers |
leetcode_386 |
|
1276 |
Sum of Two Integers |
Python |
binary_addition |
1283 |
Reverse String |
leetcode_344 |
|
1284 |
Integer Break |
Python |
ๅๅ็ฑปDP |
1292 |
Odd Even Linked List |
leetcode_328 |
|
1300 |
Bash Game(Nim Game) |
leetcode_292 |
|
1311 |
Lowest Common Ancestor of a Binary Search Tree |
Python |
|
1317 |
Count Complete Tree Nodes |
leetcode_222 |
|
1319 |
Contains Duplicate II |
leetcode_219 |
|
1320 |
Contains Duplicate |
leetcode_217 |
|
1324 |
Count Primes |
leetcode_204 |
|
1321๐ |
Combination Sum III |
leetcode_216 |
|
1333 |
Reverse Bits |
leetcode_190 |
|
1334 |
Rotate Array |
leetcode_189 |
|
1343 |
Sum of Two Strings |
Python |
|
1354 |
Pascals Triangle II |
leetcode_119 |
|
1355 |
Pascals Triangle |
leetcode_118 |
|
1359 |
Convert Sorted Array to Binary Search Tree |
Python |
divide_and_conquer |
1363 |
ZigZag Conversion |
leetcode_6 |
|
1375 |
Substring With At Least K Distinct Characters |
Python |
|
1424 |
Longest Mountain in Array |
leetcode_845 |
|
1428 |
Keys and Rooms |
leetcode_841 |
|
1438 |
Positions of Large Groups |
leetcode_830 |
|
1479 |
Can Reach The Endpoint |
Python |
bfs |
1492 |
Koko Eating Bananas |
leetcode_875 |
|
1499 |
Reordered Power of 2 |
Python |
permutation |
1508 |
Score After Flipping Matrix |
Python |
greedy |
1509 |
Lemonade Change |
Rust |
|
1524 |
Search in a Binary Search Tree |
leetcode_700 |
|
1525 |
N-ary Tree Postorder Traversal |
Python |
|
1529 |
N-ary Tree Preorder Traversal |
Python |
|
1533 |
N-ary Tree Level Order Traversal |
leetcode_429 |
|
1536 |
Find First and Last Position of Element ... |
leetcode_34 |
|
1593 |
Construct Binary Tree from Preorder and Postorder ... |
Python |
DFS |
1609 |
Middle of the Linked List |
leetcode_228 |
|
1704 |
Range Sum of BST |
leetcode_938 |
|
1790๐ |
Rotate String II |
Python |
reverse, circle_shift |
1848_FAILED |
Word Search III |
Python |
|
1870 |
number of substrings with all zeroes |
Python |
|
1872 |
Minimum Cost To Connect Sticks |
leetcode_1167 |
|
1876 |
Alien Dictionary(easy) |
Python |
|
1901 |
Squares of a Sorted Array |
leetcode_977 |
|