All Leetcode Problems

I have solved 405 / 1005 problems. I use this page to record the questions which I did on the Leetcode.

Last Updated: 2019-05-02 18:26:12

Here's a list of absolute, must-have knowledge. For each of these topics, make sure you understand how to use and implement then and, where applicable, the space and time.

Data Structures Algorithm Concepts
Vector/Array/Matrix, string Breadth-First Search Bit Manipulation
Linked-List Depth-First Search Memory(Stack vs Heap)
Tree, Tries, & Graphs Binary-Search Recursion
Stack & Queues Sort Dynamic Programming
Hash-Table Merge Sorting Big O time & Space
Heaps Quick Sorting Greedy
Divide-And-Conquer

Other algorithm will include: Math, Two Points, Recursion, Divide-And-Conquer, Combinations and Permutations

This table include: Question Number, Questions Name, Question Difficulty, Question Type, And when I did it.

# Title Difficulty Topics
1 Two-Sum Easy Array
2 Add-Two-Numbers Medium Linked
3 Longgest-Substring-Without-Repeating-Characters Medium String
4 Median-of-Two-Sorted-Arrays Hard Array
5 Longest-Palindromic-Substring Medium String
7 Reverse-Integer Easy Array
8 String-to-Integer Medium String
9 Palindrome-Number Easy Math
10 Regular-Expression-Match Hard String
11 Container-With-Most-Water Medium Math
12 Integer-to-Roman Medium Math
13 Roman-to-Integer Easy Array
14 Longest-Common-Prefix Easy Null
15 3Sum Easy Array
16 3Sum-Closest Medium Array
17 Letter-Combinations-of-a-Phone-Number Medium Null
18 4Sum Medium Array
19 Remove-Nth-Node-From-End-Of-List Medium Two
20 Valid-Parentheses Easy Stack
21 Merge-Two-Sorted-Lists Easy Linked
22 Generate-Parentheses Null Null
23 Merge-K-Sorted-Lists Hard Linked
24 Swap-Nodes-In-Pairs Medium Linked
25 Reverse-Nodes-In-K-Group Hard Linked
26 Remove-Duplicates-From-Sorted-Array Null Null
27 Remove-Element Easy Array
28 Implement-StrStr Easy String
29 Divide-Two-Integers Medium Null
31 Next-Permutation Medium Array
32 Longest-Valid-Parentheses Hard Dynamic
33 Search-In-Rotated-Sorted-Array Null Null
34 Find-First-And-Last-Position-Of-Element-In-Sorted-Array Medium Array
35 Search-Insert-Position Null Null
36 Valid-Sudoku Medium HashTable
37 Sudoku-Solver Hard Hash
38 Count-And-Say Null Null
39 Combination-Sum Null Null
40 Combination-Sum-II Null Null
41 First-Missing-Positive Medium Array
42 Trapping-Rain-Water Hard Null
43 Multiply-String Medium Null
44 Wildcard-Matching Hard Null
45 Jump-Game-II Hard Greedy
46 Permutations Medium Backtracking
47 Permutations-II Medium Backtracking
48 Rotate-Image Medium Array
49 Group-Anagrams Easy Hash
50 Powerx-n Medium Math
53 Maximum-Subarray Easy Array
54 Spiral-Matrix Null Null
55 Jump-Game Medium Array
56 Merge-Intervals Medium Array
57 Insert-Interval Medium Null
58 Length-of-Last-Word Null Null
59 Spiral-Matrix-II Null Null
60 Permutation-Sequence Medium Math
61 Rotate-List Medium Linked
62 Unique-Paths Medium Array
63 Unique-Paths-II Medium Array
64 Minimum-Path-Sum Medium Array
65 Valid-Number Hard Math
66 Plus-One Easy Array
67 Add-Binary Easy String
69 Sqrt-x-3 Easy Math
70 Climbing-Stairs Easy DP
72 Edit-Distance Hard String
73 Set-Matrix-Zeroes Medium Array
74 Search-a-2D-Matrix Medium Array
75 Sort-Colors Medium Array
76 Minimum-Window-Substring Medium Hard
77 Combinations Null Null
78 Subsets Medium Null
79 Word-Search Medium Array
80 Remove-Duplicates-From-Sorted-Array-II Null Null
81 Search-In-Rotated-Sorted-Array-II Null Null
82 Remove-Duplicates-From-Sorted-List-II Medium Linked
83 Remove-Duplicates-From-Sorted-List Easy Linked
84 Largest-Rectangle-in-histogram Medium Array
85 Maximal-Rectangle Hard Array
86 Partition-List Medium Linked
87 Scramble-String Hard String
88 Merge-Sorted-Array Easy Array
89 Gray-Code Medium Backtracking
90 Subset-II Medium Null
91 Decode-Ways Medium String
92 Reverse-Linked-List-II Medium Linked
93 Restore-IP-Addresses Null Null
94 Binary-Tree-Inorder-Traversal Medium Tree
95 Unique-Binary-Search-Trees-II Medium Dynamic
96 Unique-Binary-Search-Trees Medium Tree
97 Interleaving-String Hard String
98 Validate-Binary-Search-Tree Medium Tree
99 Recover-Binary-Search-Tree Hard Tree
100 Same-Tree Easy Tree
101 Symmetrix-Tree Easy Tree
102 Binary-Tree-Level-Order-Traversal Medium Tree
103 Binary-Tree-Zigzag-Level-Order-Traversal Medium Tree
104 Maximum-Depth-of-Binary-Tree Easy Tree
105 Construct-Binary-Tree-From-Preorder-and-Inorder-Traversal Medium Tree
106 Construct-Binary-Tree-From-Inorder-And-Postorder-Traversal Medium Tree
107 Binary-Tree-Level-Order-Traversal-II Medium Null
108 Convert-Sorted-Array-To-Binary-Search-Tree Easy Tree
109 Convert-Sorted-List-to-Binary-Search-Tree Medium Linked
110 Balanced-Binary-tree Easy Tree
111 Minimum-Depth-of-Binary-Tree Easy Tree
112 Path-Sum Medium Tree
113 Path-Sum-II Medium Tree
114 Flatten-Binary-Tree-To-Linked-List Medium Tree
115 Distinct-Subsequences Hard String
116 Populating-Next-Right-Pointers-In-Each-Node Medium Tree
117 Populating-Next-Right-Pointers-In-Each-Node-II Medium Tree
118 Pascal-Triangle Null Null
119 Pascal-Triangle-II Null Null
120 Triangle Medium Array
121 Best-Time-to-Buy-and-Sell-Stock Null Null
122 Best-Time-To-Buy-and-Sell-Stock-II Null Null
123 Best-Time-To-buy-and-sell-Stock-III Hard Dynamic
124 Binary-Tree-Maximum-Path-Sum Hard Tree
125 Valid-Palindrome Easy Null
128 Longest-Consecutive-Sequence Null Null
129 Sum-Root-to-Leaf-Numbers Medium Tree
131 Palindrome-Partitioning Medium Backtracking
132 Palindrome-Partitioning-II Hard Dynamic
133 Clone-Graph Medium Depth
134 Gas-Station Medium Greedy
136 Single-Number Medium HashTable
137 Single-Number-II Medium Bit
138 Copy-List-With-Random-Pointer Medium HashTable
139 Word-Break Medium Dynamic
141 Linked-List-Cycle Easy Linked
142 Linked-List-Cycle-II Medium Linked
143 Reorder-List Medium Linked
144 Binary-Tree-Preorder-Traversal Medium Tree
145 Binary-Tree-Postorder-Travesal Hard Tree
146 LRU-Cache Medium Design
147 Insertion-Sort-List Medium Linked
148 Sort-List Medium Linked
150 Evaluate-Reverse-Polish-Notation Medium Stack
153 Find-Minimum-in-Rotated-Sorted-Array Medium Null
154 Find-Minimum-in-Rotated-Sorted-Array-II Hard Null
155 Min-Stack Easy Stack
160 Intersection-of-Two-Linked-Lists Easy Linked
161 One-Edit-Distance Medium Null
162 Find-Peak-Element Medium Null
164 Maximum-Gap Hard Sort
167 Two-Sum-II-Input-Array-Is-Sorted Null Null
168 Excel-Sheet-Column-Title Easy Null
169 Majority-Element Easy Array
171 Excel-Sheet-Column-Number Easy Math
172 Factorial-Trailing-Zeroes Easy Math
173 Binary-Search-Tree-Iterator Medium Stack
174 Dungeon-Game Hard Binary
179 Largest-Number Medium Null
189 Rotate-Array Null Null
190 Reverse-Bits Easy Bit
198 House-Robber Easy Dynamic
199 Binary-Tree-Right-Side-View Medium Tree
200 Number-of-Islands Medium Null
206 Reverse-Linked-List Easy Linked
209 Minimum-Size-Subarray-Sum Medium Null
212 Word-Search-II Hard Backtracking
213 House-Robber-II Medium Null
215 Kth-Largest-Element-in-an-Array Medium Null
216 Combination-Sum-III Null Null
217 Contains-Duplicate Easy Array
222 Count-Complete-Tree-Nodes Medium Tree
225 Implement-Stack-using-Queues Easy Stack
226 Invert-Binary-Tree Medium Tree
230 Kth-Smallest-Element-in-a-BST Medium Null
231 Power-of-Two Easy Math
234 Palindrome-Linked-List Easy Linked
235 Lowest-Common-Ancestor-of-a-Binary-Search-Tree Easy Null
236 Lowest-Common-Ancestor-of-a-Binary-Tree Medium Tree
240 Search-a-2D-Matrix-II Medium Null
241 Different-Ways-to-Add-Parentheses Medium DP
242 Valid-Anagram Easy Sort
252 Meeting-Rooms Easy Null
253 Meeting-Rooms-II Medium Null
257 Binary-Tree-Paths Easy Tree
260 Single-Number-III Medium Null
268 Misssing-Number Null Null
274 H-Index Medium Hash
275 H-Index-II Medium Array
277 Find-the-Celebrity Medium Null
278 First-Bad-Version Easy Binary
283 Move-Zeroes Medium Array
287 Find-the-Duplicate-Number Medium Array
300 Longest-Increasing-Subsequence Medium Dynamic
301 Remove-Invalid-Parentheses Hard DFS
303 Range-Sum-Query-Immutable Easy Dynamic
307 Range-Sum-Query-Mutable Medium Null
312 Burst-Balloons Hard Dynamic
315 Count-of-Smaller-Numbers-After-Self Medium Null
318 Maximum-Product-of-Word-Lengths Medium Bit
324 Wiggle-Sort-II Medium Sort
325 Maximum-Size-Subarray-Sum-Equal-k Medium Null
337 House-Robber-III Medium Tree
338 Counting-Bits Medium Null
342 Power-of-Four Easy Bit
344 Reverse-String Easy Null
345 Reverse-Vowels-of-a-String Easy Null
347 Top-K-Frequent-Elements Medium Bubble
349 Intersection-of-two-Arrays Easy Hash
350 Intersection-Of-Two-Arrays-II Easy Hash
357 Count-Numbers-with-Unique-Digits Medium Math
371 Sum-of-Two-Integers Medium Bit
374 Guess-Number-Higher-Or-Lower Easy Binary
378 Kth-Smallest-Element-in-a-Sorted-Matrix Medium Binary
383 Ransom-Note Null Null
385 Mini-Parser Null Null
387 First-Unique-Character-In-A-String Null Null
389 Find-the-Difference Easy Hash
404 Sum-of-Left-Leaves Easy Tree
406 Queue-Reconstruction-by-Height Medium Greedy
416 Partition-Equal-Subset-Sum Medium Null
426 Convert-Binary-Search-Tree-to-Sorted-Doubly-Linked-List Medium Null
429 N-ary-Tree-Level-Order-Traversal Easy Tree
434 Number-of-Segments-in-a-String Null Null
437 Path-Sum-III Easy Tree
438 Find-All-Anagrams-in-a-String Easy Hash
442 Find-All-Duplicates-In-An-Array Medium Array
443 String-Compression Null Null
445 Add-Two-Numbers-II Medium Linked
448 Find-All-Numbers-Disappeared-In-An-Array Easy Array
449 Serialize-and-Deserialize-BST Medium Tree
450 Delete-Node-in-a-BST Medium Tree
451 Sort-Characters-By-Frequency Medium Hash
459 Repeated-Substring-Pattern Null Null
461 Hamming-Distance Medium Bit
464 Can-I-Win Medium Dynamic
476 Number-Complement Easy Bit
485 Max-Consecutive-Ones Easy Array
489 Robot-Room-Cleaner Medium Null
494 Target-Sum Medium Dynamic
501 Find-Mode-in-Binary-Search-Tree Easy Tree
503 Next-Greater-Element-II Medium Stack
506 Relative-Ranks Easy Binary
509 Fibonacci-Number Medium Recursion
513 Find-Bottom-Left-Tree-Value Medium Tree
515 Find-Largest-Value-in-Each-Tree-Row Medium Tree
520 Detect-Capital Null Null
521 Longest-Uncommon-Subsequence-I Null Null
522 Longest-Uncommon-Subsequence-II Null Null
524 Longest-Word-in-Dictionary-through-Deleting Medium String
537 Complex-Number-Multiplication Null Null
538 Convert-BST-to-Greater-Tree Easy Tree
539 Minimum-Time-Difference Null Null
540 Single-Element-in-a-Sorted-Array Medium Binary
541 Reverse-String-II Null Null
543 Diameter-of-Binary-Tree Easy Tree
547 Friend-Circles Medium Null
551 Student-Attendance-Record-I Null Null
553 Optimal-Division Null Null
557 Reverse-Words-in-a-String-III Null Null
559 Maximum-Depth-of-N-ary-Tree Easy Tree
560 Subarray-Sum-Equals-K Medium Array
561 Array-Partition-I Easy Array
563 Binary-Tree-Tilt Easy Tree
566 Reshape-the-Matrix Easy Array
567 Permutation-in-String Null Null
572 Subtree-of-Another-Tree Easy Tree
581 Shortest-Unsorted-Continuous-Subarray Easy Null
583 Delete-Operation-For-Two-String Null Null
583 Delete-Operation-for-Two-Strings Medium String
589 N-ary-Tree-Preorder-Traversal Easy Tree
590 N-ary-Tree-Postorder-Traversal Easy Tree
599 Minimum-Index-Sum-of-Two-Lists Easy Hash
606 Construct-String-from-Binary-Tree Null Null
609 Find-Duplicate-File-in-System Null Null
617 Merge-Two-Binary-Trees Easy Tree
621 Task-Scheduler Medium Array
622 Design-Circular-Queue Medium Null
632 Smallest-Range Hard Hash
636 Exclusive-Time-of-Functions Medium Null
637 Average-of-Levels-in-Binary-Tree Medium Tree
641 Design-Circular-Deque Medium Null
645 Set-Mismatch Easy Hash
647 Palindromic-Substrings Null Null
657 Robot-Return-To-Origin Null Null
668 Kth-Smallest-Number-in-Multiplication-Table Hard Null
669 Trim-a-Binary-Search-Tree Easy Tree
671 Second-Minimum-Node-In-a-Binary-Tree Easy Tree
673 Number-of-Longest-Increasing-Subsequence Medium Dynamic
674 Longest-Continuous-Increasing-Subsequence Easy Array
680 Valid-Palindrome-II Null Null
682 Baseball-Game Medium Null
684 Redundant-Connection Medium Null
686 Repeated-String-Match Null Null
687 Longest-Univalue-Path Easy Tree
689 Maximum-Sum-of-3-Non-Overlapping-Subarrays Hard Array
693 Binary-Number-with-Alternating-Bits Medium Bit
695 Max-Area-of-Island Medium Null
696 Count-Binary-Substrings Null Null
697 Degree-of-an-Array Easy Array
704 Binary-Search Medium Null
709 To-Lower-Case Null Null
710 Random-Pick-with-Blacklist Hard Sort
712 Minimum-ASCII-Delete-Sum-for-Two-Strings Medium Null
717 1-bit-and-2-bit-characters Null Null
718 Maximum-Length-of-Repeated-Subarray Medium Null
719 Find-K-th-Smallest-Pair-Distance Hard Array
720 Longest-Word-in-Dictionary Easy Hash
724 Find-Pivot-Index Null Null
726 Number-of-Atoms Hard Hash
727 Minimum-Window-Subsequence Medium Null
729 My-Calendar-I Medium Array
734 Sentence-Similarity Medium Null
736 Parse-Lisp-Expression Hard String
737 Sentence-Similarity-II Medium Null
739 Daily-Temperatures Medium Hash
744 Find-Smallest-Letter-Greater-Than-Target Easy Binary
746 Min-Cost-Climbing-Stairs Easy Array
747 Largest-Number-At-Least-Twice-Of-Others Null Null
761 Special-Binary-String Medium Null
763 Partition-Labels Medium Two
766 Toeplitz-Matrix Easy Array
767 Reorganize-String Medium String
771 Jewels-and-Stones Easy Hash
778 Swim-in-Rising-Water Hard Null
784 Letter-Case-Permutation Easy Backtracking
786 K-th-Smallest-Prime-Fraction Hard Binary
788 Rotated-Digits Null Null
791 Custom-Sort-String Null Null
792 Number-of-Matching-Subsequences Medium String
793 Preimage-Size-of-Factorial-Zeroes-Function Hard Binary
804 Unique-Morse-Code-Words Null Null
819 Most-Common-Word Null Null
824 Goat-Latin Null Null
830 Positions-of-Large-Groups Easy Array
832 Flipping-an-Image Medium Array
833 Find-And-Replace-in-String Medium Null
841 Keys-and-Rooms Medium Null
844 Backspace-String-Compare Easy Null
852 Peak-Index-in-a-Mountain-Array Easy Binary
856 Score-Of-Parentheses Null Null
859 Buddy-Strings Null Null
862 Shortest-Subarray-with-Sum-at-Least-K Medium Null
865 Smallest-Subtree-with-all-the-Deepest-Nodes Medium Null
867 Transpose-Matrix Easy Array
875 Koko-Eating-Bananas Medium Null
884 Uncommon-Words-from-Two-Sentences Medium Hash
885 Spiral-Matrix-III Medium Math
888 Fair-Candy-Swap Easy Array
890 Find-And-Replace-Pattern Null Null
892 Surface-Area-of-3D-Shapes Medium Math
893 Groups-Of-Special_equivalent-Strings Null Null
896 Monotonic-Array Easy Array
897 Increasing-Order-Search-Tree Easy Tree
905 Sort-Array-By-Parity Easy Array
908 Smallest-Range-I Easy Math
911 Online-Election Medium Binary
914 X-of-a-Kind-in-a-Deck-of-Cards Easy Array
915 Partition-Array-into-Disjoint-Intervals Medium Array
917 Reverse-Only-Letters Easy String
921 Minimum-Add-to-Make-Parentheses-Valid Medium Null
922 Sort-Array-By-Parity-II Easy Array
925 Long-Pressed-Name Easy Two
929 Unique-Email-Addresses Easy String
933 Number-of-Recent-Calls Easy Queue
937 Reorder-Log-Files Easy Null
941 Valid-Mountain-Array Easy Math
942 DI-String-Match Easy Math
943 Find-the-Shortest-Superstring Hard Null
946 Validate-Stack-Sequences Medium Stack
949 Largest-Time-for-Given-Digits Easy Math
951 Flip-Equivalent-Binary-Trees Medium Tree
953 Verifying-an-Alien-Dictionary Easy Hash
957 Prison-Cells-After-N-Days Medium Null
958 Check-Completeness-of-a-Binary-Tree Medium Null
961 N-Repeated-Element-in-Size-2N-Array Easy Hash
962 Maximum-Width-Ramp Medium Null
963 Minimum-Area-Rectangle-II Medium Math
964 Least-Operators-to-Express-Number Hard Dynamic
965 Univalued-Binary-Tree Easy Tree
967 Numbers-With-Same-Consecutive-Differences Medium Null
969 Pancake-Sorting Medium Array
970 Powerful-Integers Easy Math
973 K-Closest-Points-to-Origin Easy Math
974 Subarray-Sums-Divisible-by-K Medium Array
975 Odd-Even-Jump Medium Null
976 Largest-Perimeter-Triangle Easy Array
977 Squares-of-a-Sorted-Array Medium Null
978 Longest-Turbulent-Subarray Medium Array
979 Distribute-Coins-in-Binary-Tree Hard Tree
980 Unique-Paths-III Hard Dynamic
981 Time-Based-Key-Value-Store Medium Null
984 String-Without-AAA-or-BBB Medium Null
985 Sum-of-Even-Numbers-After-Queries Easy Null
986 Interval-List-Intersections Medium Null
987 Vertical-Order-Traversal-of-a-Binary-Tree Medium Tree
988 Smallest-String-Starting-From-Leaf Medium Null
989 Add-to-Array-Form-of-Integer Easy Null
990 Satisfiability-of-Equality-Equations Medium Null
992 Subarrays-with-K-Different-Integers Hard Null
993 Cousins-in-Binary-Tree Easy Null
994 Rotting-Oranges Medium Null
996 Number-of-Squareful-Arrays Hard Null
1005 Maximize-Sum-Of-Array-After-K-Negations Easy Null
1006 Clumsy-Factorial Medium Null
1012 Complement-of-Base-10-Integer Easy Null
1013 Pairs-of-Songs-With-Total-Durations-Divisible-by-60 Medium Null
1014 Capacity-To-Ship-Packages-Within-D-Days Medium Null
1020 Partition-Array-Into-Three-Parts-With-Equal-Sum Easy Null
1021 Best-Sightseeing-Pair Medium Null
1022 Smallest-Integer-Divisible-by-K Medium Null
Edit by guozetang all right reserved,powered by GitbookFile Modify: 2019-05-02 23:26:17

results matching ""

    No results matching ""