Leetcode solutions written in Javascript
分类标准
- 重点:必须掌握的题型。通常都有着代表一类题型的解法,或者可以举一反三。
- 提高:难度相对高的题,或者思路巧妙的题,提升自我的目的可以练习。
- 了解:一般是解法很容易想到但是细节繁琐,或者和重点题型的解法重复。
String
重点
Number | Title | Difficulty |
---|---|---|
9 | Palindrome Number | Easy |
14 | Longest Common Prefix | Easy |
20 | Valid Parentheses | Easy |
38 | Count and Say | Easy |
67 | Add Binary | Easy. |
125 | Valid Palindrome | Easy |
205 | Isomorphic Strings | Easy |
344 | Reverse String | Easy |
345 | Reverse Vowels of a String | Easy |
434 | Number of Segments in a String | Easy |
459 | Repeated Substring Pattern | Easy |
541 | Reverse String II | Easy |
606 | Construct String from Binary Tree | Easy |
680 | Valid palindrome II | Easy |
686 | Repeated String Match | Easy |
696 | Count Binary Substrings | Easy |
819 | Most Common Word | Easy |
3 | Longest Substring Without Repeating Characters | Medium |
5 | Longest Palindromic Substring | Medium |
17 | Letter Combinations of a Phone Number | Medium |
22 | Generate parentheses | Medium |
131 | Palindrome Partitioning | Medium |
241 | Different Ways to Add Parentheses | Medium |
392 | Is Subsequence | Medium |
395 | Longest Substring with At Least K Repeating Character | Medium |
647 | Palindromic Substrings | Medium |
提高
Number | Title | Difficulty |
---|---|---|
30 | Substring with Concatenation of All Words | Hard |
32 | Longest Valid Parentheses | Hard |
76 | Minimum Window Substring | Hard |
115 | Distinct Subsequences | Hard |
132 | Palindrome Partitioning II | Hard |
301 | Remove Invaild Parentheses | Hard |
316 | Remove Duplicate Letters | Hard |
336 | Palindrome Pairs | Hard |
了解
Number | Title | Difficulty |
---|---|---|
13 | Roman To Integer | Easy |
28 | Implement strStr() | Easy |
58 | Length of Last Word | Easy |
168 | Excel Sheet Column Title | Easy |
171 | Excel Sheet Column Number | Easy |
242 | Valid Anagram | Easy |
290 | Word Pattern | Easy |
383 | Ransom Note | Easy |
387 | First Unique Character in a String | Easy |
520 | Detect Capital | Easy |
557 | Reverse Words in a String III | Easy |
657 | Robot Return to origin | Easy |
788 | Rotated Digits | Easy |
804 | Unique Morse Code Words | Easy |
12 | Integer to Roman | Medium |
49 | Group Anagrams | Medium |
151 | Reverse Words in a String | Medium |
537 | Complex Number Multiplication | Medium |
791 | Custom Sort String | Medium |
Array
重点
提高
Number | Title | Difficulty |
---|---|---|
11 | Container With Most Water | Medium |
289 | Game of Life | Medium |
299 | Bulls and Cows | Medium |
309 | Best Time to Buy and Sell Stock with Cooldown | Medium |
376 | Wiggle Subsequence | Medium |
42 | Trapping Rain Water | Hard |
123 | Best Time to Buy and Sell Stock III | Hard |
164 | Maximum Gap | Hard |
188 | Best Time to Buy and Sell Stock IV | Hard |
了解
Number | Title | Diffuculty |
---|---|---|
66 | Plus One | Easy |
169 | Majority Element | Easy |
485 | Max Consecutive Ones | Easy |
561 | Array Partition I | Easy |
661 | Image Smoother | Easy |
747 | Largest Number At Least Twice of Others | Easy |
80 | Remove Duplicates from Sorted Array II | Medium |
228 | Summary Ranges | Medium |
274 | H-Index | Medium |
Stack
重点
Number | Title | Difficulty |
---|---|---|
225 | Implement Stack using Queues | Easy |
232 | Implement Queue using Stacks | Easy |
71 | Simplify Path | Medium |
150 | Evaluate Reverse Polish Notation | Medium |
215 | Kth Largest Element in an Array | Medium |
227 | Basic Calculator | Medium |
347 | Top K Frequent Elements | Medium |
394 | Decode String | Medium |
402 | Remove K Digits | Medium |
503 | Next Greater Element II | Medium |
739 | Daily Temperatures | Medium |
224 | Basic Calculator | Hard |
提高
Number | Title | Difficulty |
---|---|---|
332 | Reconstruct Ltinerary | Medium |
388 | Longest Absolute File Path | Medium |
84 | Largest Rectangle in Histogram | Hard |
了解
Number | Title | Difficulty |
---|---|---|
155 | Min Stack | Easy |
341 | Flatten Nested list Iterator | Medium |
682 | Baseball Game | Medium |
LinkedList
重点
Number | Title | Difficulty |
---|---|---|
21 | Merge Two Sorted Lists | Easy |
83 | Remove Duplicates from Sorted List | Easy |
141 | Linked List Cycle | Easy |
160 | Intersection of Two Linked Lists | Easy |
203 | Remove Linked List Elements | Easy |
206 | Reverse Linked List | Easy |
234 | Palindrome Linked List | Easy |
237 | Delete Node in a Linked List | Easy |
2 | Add Two Numbers | Medium |
19 | Remove Nth Node From End of List | Medium |
24 | Swap Nodes in Pairs | Medium |
61 | Rotate List | Medium |
86 | Partition List | Medium |
142 | Linked List Cycle II | Medium |
147 | Insertion Sort List | Medium |
148 | Sort List | Medium |
328 | Odd Even Linked List | Medium |
817 | Linked List Components | Medium |
23 | Merge k Sorted List | Hard |
了解
Number | Title | Difficulty |
---|---|---|
82 | Remove Duplicates from Sorted List II | Medium |
92 | Reverse Linked List | Medium |
143 | Reorder List | Medium |
25 | Reverse Nodes in k-Group | Hard |
Tree
重点
Number | Title | Difficulty |
---|---|---|
100 | Same Tree | Easy |
101 | Symmetric Tree | Easy |
104 | Maximum Depth of Binary Tree | Easy |
107 | Binary Tree Level Order Traversal II | Easy |
108 | Convert Sorted Array to Binary Search Tree | Easy |
110 | Balanced Binary Tree | Easy |
111 | Minimum Depth of Binary Tree | Easy |
112 | Path Sum | Easy |
226 | invert Binary Tree | Easy |
235 | Lowest Common Ancestor of a Binary Search Tree | Easy |
257 | Binary Tree Paths | Easy |
94 | Binary Tree Inorder Traversal | Medium |
96 | Unique Binary Search Trees | Medium |
98 | Validate Binary Search Tree | Medium |
109 | Convert Sorted List to Binary Search Tree | Medium |
116 | Populating Next Right Pointers in Each Node | Medium |
129 | Sum Root to Leaf Numbers | Medium |
144 | Binary Tree Preorder Traversal | Medium |
230 | Kth Smallest Element in a BST | Medium |
236 | Lowest Common Ancestor of a Binary Tree | Medium |
99 | Recover Binary Search Tree | Hard |
124 | Binary Tree Maximum Path Sum | Hard |
145 | Binary Tree Postorder Traversal | Hard |
297 | Serialize and Deserialize Binary Tree | Hard |
提高
Number | Title | Difficulty |
---|---|---|
337 | House Robber III | Middle |
了解
Number | Title | Difficulty |
---|---|---|
102 | Binary Tree Level Order Traversal | Medium |
103 | Binary Tree Zigzag Level Order Traversal | Medium |
113 | Path Sum II | Medium |
173 | Binary Search Tree Iterator | Medium |
199 | Binary Tree Right Side View | Medium |
Binary Search
重点
Number | Title | Difficulty |
---|---|---|
35 | Search Insert Position | Easy |
33 | Search in Rotated Sorted Array | Medium |
315 | Count of Smaller Nunmbers After Self | Hard |
了解
Number | Title | Difficulty |
---|---|---|
278 | First Bad Version | Easy |
34 | Find First and Last Position of Element in Sorted Array | Medium |
81 | Search in Rotated Sorted Array II | Medium |
162 | Find Peak Element | Medium |
Backtracking
重点
Number | Title | Difficulty |
---|---|---|
39 | Combination Sum | Medium |
40 | Combination Sum II | Medium |
46 | Permutations | Medium |
47 | Permutations II | Medium |
了解
Number | Title | Difficulty |
---|---|---|
77 | Combinations | Medium |
78 | Subsets | Medium |
90 | Subsets II | Medium |
216 | Combination Sum III | Medium |
Dynamic Programming
重点
Number | Title | Difficulty |
---|---|---|
70 | Climbing Stairs | Easy |
198 | House Robber | Easy |
62 | Unique Path | Medium |
63 | Unique Path | Medium |
64 | Minimum Path Sum | Medium |
91 | Decode Ways | Medium |
120 | Triangle | Medium |
139 | Word Break | Medium |
221 | Maximal Square | Medium |
279 | Perfect Squares | Medium |
了解
Number | Title | Difficulty |
---|---|---|
322 | Coin Change | Medium |