Skip to content

Latest commit

 

History

History
441 lines (431 loc) · 66.1 KB

DRAFT.md

File metadata and controls

441 lines (431 loc) · 66.1 KB

LeetCode

LeetCode Algorithm

(Notes: "♥" means you need to buy a book from Leetcode)

# Title Solution Difficulty
1143 Longest Common Subsequence Python Medium
993 Cousins in Binary Tree C++ Easy
991 Broken Calculator C++ Medium
990 Satisfiability of Equality Equations C++ Medium
989 Add to Array-Form of Integer C++ Easy
988 Smallest String Starting From Leaf C++ Medium
987 Vertical Order Traversal of a Binary Tree C++ Medium
986 Interval List Intersections C++ Medium
985 Sum of Even Numbers After Queries C++ Easy
984 String Without AAA or BBB C++ Easy
983 Minimum Cost For Tickets C++ Medium
981 Time Based Key-Value Store C++ Medium
980 Unique Paths III C++ Hard
979 Distribute Coins in Binary Tree C++ Medium
978 Longest Turbulent Subarray C++,Python Medium
977 Squares of a Sorted Array C++, Python Easy
976 Largest Perimeter Triangle C++, Python Easy
971 Flip Binary Tree To Match Preorder Traversal Python Medium
969 Pancake Sorting Python Medium
961 N-Repeated element in size 2N Array C++ Easy
958 Check Completeness of a Binary Tree Python Medium
951 Flip Equivalent Binary Trees Python Medium
950 Reveal Cards In Increasing Order Python Medium
941 Valid Mountain Array Python Easy
931 Minimum Falling Path Sum C++ Medium
922 Sort Array By Parity II C++ Easy
914 X of a Kind in a Deck of Cards Python Easy
905 Sort Array By Parity C++ Easy
867 Transpose Matrix Python Easy
859 Buddy Strings C++ Easy
858 Mirror Reflection C++ Medium
852 Peak Index in a Mountain Array C++ Easy
849 Maximize Distance to Closest Person Python Easy
844 Backspace String Compare C++ Easy
837 Most Common Word C++ Easy
830 Positions of Large Groups Python Easy
804 Unique Morse Code Words C++ Easy
771 Jewels and Stones C++ Easy
747 Largest Number At Least Twice of Others Python Easy
746 Min Cost Climbing Stairs C++, Python Easy
721 Accounts Merge C++ Medium
718 Maximum Length of Repeated Subarray Python, Go Medium
717 1-bit and 2-bit Characters Python Easy
714 Best Time to Buy and Sell Stock with Transaction Fee C++ Medium
712 Minimum ASCII Delete Sum for Two Strings C++ Medium
695 Max Area of Island C++ Medium
692 Top K Frequent Words Python Medium
687 Longest Univalue Path Python Easy
684 Redundant Connection Python Medium
674 Longest Continuous Increasing Subsequence Python Easy
673 Number of Longest Increasing Subsequence Python Medium
671 Second Minimum Node In a Binary Tree Python Easy
665 Non-decreasing Array Python Easy
662 Maximum Width of Binary Tree Python Medium
661 Image Smoother Python Easy
655 Print Binary Tree Python Medium
653 Two Sum IV - Input is a BST Python Easy
652 Find Duplicate Subtrees Python Medium
647 Palindromic Substrings C++ Medium
643 Maximum Average Subarray I C++, Python Easy
628 Maximum Product of Three Numbers Python Easy
623 Add One Row to Tree Python Medium
590 N-ary Tree Postorder Traversal Python Easy
589 N-ary Tree Preorder Traversal Python Easy
581 Shortest Unsorted Continuous Subarray Python Easy
572 Subtree of Another Tree Python Easy
566 Reshape the Matrix Python Easy
563 Binary Tree Tilt Python Easy
561 Array Partition I Python Easy
559 Maximum Depth of N-ary Tree Python Easy
547 Friend Circles C++ Medium
543 Diameter of Binary Tree Python Easy
538 Convert BST to Greater Tree Python Easy
532 K-diff Pairs in an Array Python Easy
520 Detect Capital C++ Easy
518 Coin Change 2 Python Medium
516 Longest Palindromic Subsequence Python Medium
509 Fibonacci Number Python Easy
485 Max Consecutive Ones Python Medium
477 Total Hamming Distance C++ Medium
468 Validate IP Address Python Medium
463 Island Perimeter C++ Easy
454 4Sum II Python Medium
450 DeleteNodeInABST Python Medium
449 Serialize and Deserialize BST Python Medium
445 Add Two Numbers II Python Medium
438 Find all Anagrams in a string C++ Medium
437 Path Sum III Python Medium
429 N-ary Tree Level Order Traversal Python Medium
418 SentenceScreenFitting C++ Easy
416 Partition Equal Subset Sum C++ Medium
415 Add Strings C++ Easy
414 Third Maximum Number C++, Python Easy
413 Arithmetic Slices C++ Medium
412 Fizz Buzz C++ Easy
410 Split Array Largest Sum C++ Hard
409 Longest Palindrome Python Easy
406 Queue Reconstruction by Height C++ Medium
405 Convert a Number to Hexadecimal C++ Easy
404 Sum of Left Leaves C++, Python Easy
403 Frog Jump C++ Hard
402 Remove K Digits C++ Medium
401 Binary Watch C++ Easy
400 Nth Digit C++ Medium
399 Evaluate Division C++ Medium
398 Random Pick Index C++ Medium
397 Integer Replacement C++ Medium
396 Rotate Function C++ Easy
395 Longest Substring with At Least K Repeating Characters C++ Medium
394 Decode String C++ Medium
393 UTF-8 Validation C++ Medium
392 Is Subsequence C++ Medium
391 Perfect Rectangle C++ Hard
390 Elimination Game C++ Medium
389 Find the Difference C++ Easy
388 Longest Absolute File Path C++ Medium
387 First Unique Character in a String C++ Easy
386 Lexicographical Numbers C++ Medium
385 Mini Parser C++ Medium
384 Shuffle an Array C++ Medium
383 Ransom Note C++ Easy
382 Linked List Random Node C++ Medium
381 Insert Delete GetRandom O(1) - Duplicates allowed C++ Hard
380 Insert Delete GetRandom O(1) C++ Hard
377 Combination Sum IV Python Medium
376 Wiggle Subsequence C++ Medium
371 Sum of Two Integers Python Easy
367 Valid Perfect Square Python Easy
357 Count Numbers with Unique Digits C++ Medium
350 Intersection of Two Arrays II Python Easy
349 Intersection of Two Arrays Python Easy
347 Top K Frequent Elements Python Medium
345 Reverse Vowels of a String Python Easy
344 Reverse String Python Easy
343 Integer Break C++ Medium
342 Power of Four Python Easy
341 Flatten Nested List Iterator C++ Medium
338 Counting Bits C++ Medium
337 House Robber III Python Medium
336 Palindrome Pairs C++ Hard
334 Increasing Triplet Subsequence C++ Medium
332 Reconstruct Itinerary C++ Medium
331 Verify Preorder Serialization of a Binary Tree C++ Medium
330 Patching Array C++ Medium
329 Longest Increasing Path in a Matrix C++ Medium
328 Odd Even Linked List Python Easy
327 Count of Range Sum C++ Hard
326 Power of Three Python Easy
324 Wiggle Sort II C++ Medium
322 Coin Change C++ Medium
321 Create Maximum Number C++ Hard
319 Bulb Switcher C++ Medium
318 Maximum Product of Word Lengths C++ Medium
316 Remove Duplicate Letters C++ Hard
315 Count of Smaller Numbers After Self C++ Hard
313 Super Ugly Number C++ Medium
312 Burst Balloons C++ Hard
310 Minimum Height Trees C++ Medium
309 Best Time to Buy and Sell Stock with Cooldown Python Medium
307 Range Sum Query - Mutable C++ Medium
306 Additive Number C++ Medium
304 Range Sum Query 2D - Immutable C++ Medium
303 Range Sum Query - Immutable Python Easy
301 Remove Invalid Parentheses C++ Hard
300 Longest Increasing Subsequence Python Medium
299 Bulls and Cows C++ Easy
297 Serialize and Deserialize Binary Tree C++ Medium
295 Find Median from Data Stream C++ Hard
292 Nim Game Python Easy
290 Word Pattern Python Easy
289 Game of Life C++ Medium
287 Find the Duplicate Number C++, Python Hard
285 Inorder Successor in BST Java Medium
284 Peeking Iterator C++ Medium
283 Move Zeroes Python Easy
282 Expression Add Operators C++ Hard
279 Perfect Squares C++ Medium
278 First Bad Version Python Easy
275 H-Index II C++ Medium
274 H-Index C++ Medium
273 Integer to English Words C++ Medium
268 Missing Number Python Medium
264 Ugly Number II C++ Medium
263 Ugly Number Python Easy
260 Single Number III C++ Medium
258 Add Digits Python Easy
257 Binary Tree Paths Python Easy
242 Valid Anagram Python Easy
241 Different Ways to Add Parentheses Python Medium
240 Search a 2D Matrix II C++, Java, Python Medium
239 Sliding Window Maximum C++ Hard
238 Product of Array Except Self Python Medium
237 Delete Node in a Linked List Python Easy
236 Lowest Common Ancestor of a Binary Tree Python Medium
235 Lowest Common Ancestor of a Binary Search Tree Python Easy
234 Palindrome Linked List Python Easy
233 Number of Digit One C++ Medium
232 Implement Queue using Stacks Python Easy
231 Power of Two Python Easy
230 Kth Smallest Element in a BST C++, Python Medium
229 Majority Element II C++ Medium
228 Summary Ranges Python Easy
227 Basic Calculator II C++ Medium
226 Invert Binary Tree Python Easy
225 Implement Stack using Queues Python Medium
224 Basic Calculator Python Medium
223 Rectangle Area C++ Easy
222 Count Complete Tree Nodes C++, Python Medium
221 Maximal Square Python Medium
220 Contains Duplicate III C++, Python Medium
219 Contains Duplicate II Python Easy
218 The Skyline Problem C++ Hard
217 Contains Duplicate Python Easy
216 Combination Sum III C++ Medium
215 Kth Largest Element in an Array C++ Medium
214 Shortest Palindrome C++ Hard
213 House Robber II Python Medium
212 Word Search II C++ Hard
211 Add and Search Word - Data structure design C++ Medium
210 Course Schedule II C++ Medium
209 Minimum Size Subarray Sum C++ Medium
208 Implement Trie (Prefix Tree) C++ Medium
207 Course Schedule C++ Medium
206 Reverse Linked List Python Easy
205 Isomorphic Strings Python Easy
204 Count Primes Python Easy
203 Remove Linked List Elements Python Easy
202 Happy Number Python Easy
201 Bitwise AND of Numbers Range C++ Medium
200 Number of Islands Python Medium
199 Binary Tree Right Side View Python Medium
198 House Robber Python Easy
191 Number of 1 Bits Python Easy
190 Reverse Bits Python Easy
189 Rotate Array Python Easy
188 Best Time to Buy and Sell Stock IV Python Hard
187 Repeated DNA Sequences C++ Medium
186 Reverse Words in a String II C++ Medium
179 Largest Number C++ Medium
174 Dungeon Game C++ Hard
173 Binary Search Tree Iterator C++, Java, Python Medium
172 Factorial Trailing Zeroes Python Easy
171 Excel Sheet Column Number Python Easy
170 Two Sum III - Data structure design C++ Easy
169 Majority Element Python Easy
168 Excel Sheet Column Title Python Easy
167 Two Sum II - Input array is sorted Python Medium
166 Fraction to Recurring Decimal C++ Medium
165 Compare Version Numbers C++ Easy
164 Maximum Gap C++ Hard
163 Missing Ranges C++ Medium
162 Find Peak Element C++, Java Medium
161 One Edit Distance C++ Medium
160 Intersection of Two Linked Lists Python Easy
159 Longest Substring with At Most Two Distinct Characters C++ Hard
158 Read N Characters Given Read4 II - Call multiple times C++ Hard
157 Read N Characters Given Read4 C++ Easy
156 Binary Tree Upside Down C++ Medium
155 Min Stack C++, Java Easy
154 Find Minimum in Rotated Sorted Array II C++ Hard
153 Find Minimum in Rotated Sorted Array C++, Java Medium
152 Maximum Product Subarray Python Medium
151 Reverse Words in a String C++, Java Medium
150 Evaluate Reverse Polish Notation Python Medium
149 Max Points on a Line C++ Hard
148 Sort List C++, Python Medium
147 Insertion Sort List C++, Python Medium
146 LRU Cache Python Hard
145 Binary Tree Postorder Traversal Python Hard
144 Binary Tree Preorder Traversal Python Medium
143 Reorder List C++, Python Medium
142 Linked List Cycle II C++, Python Medium
141 Linked List Cycle Python Medium
140 Word Break II C++ Hard
139 Word Break C++ Medium
138 Copy List with Random Pointer C++, Python Hard
137 Single Number II C++ Medium
136 Single Number Python Medium
135 Candy C++ Hard
134 Gas Station C++ Medium
133 Clone Graph C++ Medium
132 Palindrome Partitioning II C++ Hard
131 Palindrome Partitioning C++ Medium
130 Surrounded Regions C++ Medium
129 Sum Root to Leaf Numbers C++, Python Medium
128 Longest Consecutive Sequence Python Hard
127 Word Ladder C++ Medium
126 Word Ladder II C++ Hard
125 Valid Palindrome Python Easy
124 Binary Tree Maximum Path Sum C++, Java Hard
123 Best Time to Buy and Sell Stock III Python Hard
122 Best Time to Buy and Sell Stock II Python Medium
121 Best Time to Buy and Sell Stock Python Medium
120 Triangle Python Medium
119 Pascal's Triangle II Python Easy
118 Pascal's Triangle Python Easy
117 Populating Next Right Pointers in Each Node II C++, Python Hard
116 Populating Next Right Pointers in Each Node C++, Python Medium
115 Distinct Subsequences Python Hard
114 Flatten Binary Tree to Linked List C++, Python Medium
113 Path Sum II C++, Python Medium
112 Path Sum Python Easy
111 Minimum Depth of Binary Tree Python Easy
110 Balanced Binary Tree C++, Java Easy
109 Convert Sorted List to Binary Search Tree C++ Medium
108 Convert Sorted Array to Binary Search Tree C++ Medium
107 Binary Tree Level Order Traversal II Python Easy
106 Construct Binary Tree from Inorder and Postorder Traversal Python Medium
105 Construct Binary Tree from Preorder and Inorder Traversal Python Medium
104 Maximum Depth of Binary Tree Python Easy
103 Binary Tree Zigzag Level Order Traversal Python Medium
102 Binary Tree Level Order Traversal Python Easy
101 Symmetric Tree Python Easy
100 Same Tree Python Easy
099 Recover Binary Search Tree C++ Hard
098 Validate Binary Search Tree Python Medium
097 Interleaving String C++ Hard
096 Unique Binary Search Trees Python Medium
095 Unique Binary Search Trees II Python Medium
094 Binary Tree Inorder Traversal Python Medium
093 Restore IP Addresses C++ Medium
092 Reverse Linked List II Python Medium
091 Decode Ways C++ Medium
090 Subsets II C++, Java Medium
089 Gray Code C++ Medium
088 Merge Sorted Array Python Easy
087 Scramble String C++ Hard
086 Partition List C++, Python Medium
085 Maximal Rectangle C++ Hard
084 Largest Rectangle in Histogram C++ Hard
083 Remove Duplicates from Sorted List Python Easy
082 Remove Duplicates from Sorted List II C++, Python Medium
081 Search in Rotated Sorted Array II C++ Medium
080 Remove Duplicates from Sorted Array II C++ Medium
079 Word Search C++ Medium
078 Subsets Python Medium
077 Combinations Python, Go Medium
076 Minimum Window Substring Python Hard
075 Sort Colors Python Medium
074 Search a 2D Matrix Python Medium
073 Set Matrix Zeroes Python Medium
072 Edit Distance Python Hard
071 Simplify Path C++ Medium
070 Climbing Stairs Python Easy
069 Sqrt(x) Python Medium
068 Text Justification C++ Hard
067 Add Binary C++ Easy
066 Plus One Python Easy
065 Valid Number C++ Easy
064 Minimum Path Sum Python, Go Medium
063 Unique Paths II Python Medium
062 Unique Paths Python Medium
061 Rotate List C++ Medium
060 Permutation Sequence C++ Medium
059 Spiral Matrix II C++ Medium
058 Length of Last Word Python Easy
057 Insert Interval C++ Hard
056 Merge Intervals C++ Hard
055 Jump Game C++ Medium
054 Spiral Matrix C++ Medium
053 Maximum Subarray Python Medium
052 N-Queens II Python Hard
051 N-Queens Python Hard
050 "Pow(x, n)" C++, Java Medium
049 Group Anagrams Python Medium
048 Rotate Image C++ Medium
047 Permutations II Python Hard
046 Permutations Python Medium
045 Jump Game II C++ Hard
044 Wildcard Matching Python Hard
043 Multiply Strings Python Medium
042 Trapping Rain Water Python, Go Hard
041 First Missing Positive Python Hard
040 Combination Sum II Python Medium
039 Combination Sum Python Medium
038 Count and Say Python Easy
037 Sudoku Solver C++ Hard
036 Valid Sudoku C++ Easy
035 Search Insert Position Python Medium
034 Search for a Range Python) Medium
033 Search in Rotated Sorted Array Python Hard
032 Longest Valid Parentheses Python Hard
031 Next Permutation Python Medium
030 Substring with Concatenation of All Words C++ Hard
029 Divide Two Integers Python Medium
028 Implement strStr() Python Easy
027 Remove Element Python Easy
026 Remove Duplicates from Sorted Array Python Easy
025 Reverse Nodes in k-Group C++ Hard
024 Swap Nodes in Pairs Python Medium
023 Merge k Sorted Lists Python Hard
022 Generate Parentheses Python Medium
021 Merge Two Sorted Lists Python Easy
020 Valid Parentheses Python Easy
019 Remove Nth Node From End of List Python Easy
018 4Sum Python Medium
017 Letter Combinations of a Phone Number Python Medium
016 3Sum Closest Python Medium
015 3Sum Python Medium
014 Longest Common Prefix Python Easy
013 Roman to Integer Python Easy
012 Integer to Roman Python Medium
011 Container With Most Water Python Medium
010 Regular Expression Matching C++ Hard
009 Palindrome Number Python Easy
008 String to Integer (atoi) Python Easy
007 Reverse Integer Python Easy
006 ZigZag Conversion Python Easy
005 Longest Palindromic Substring Python Medium
004 Median of Two Sorted Arrays Python Hard
003 Longest Substring Without Repeating Characters Python Medium
002 Add Two Numbers Python Medium
001 Two Sum Python Easy

LeetCode Shell

# Title Solution Difficulty
1 Word Frequency Bash Medium
2 Valid Phone Numbers Bash Easy
3 Transpose File Bash Medium
4 Tenth Line Bash Easy

LintCode

# Title Solution Difficulty
1 Search in a big sorted array Java Medium
2 Search Range in Binary Search Tree Java Medium