Skip to content

Latest commit

 

History

History
364 lines (360 loc) · 58.2 KB

1-300.md

File metadata and controls

364 lines (360 loc) · 58.2 KB

LeetCode Problems' Solutions [力扣话题分类]

Build Status codecov Go Report Card GitHub contributors license FOSSA Status Join the chat

[1-50] [51-100] [101-150] [151-200] [201-250] [251-300]
[301-350] [351-400] [401-450] [451-500] [501-550] [551-600]
[601-650] [651-700] [701-750] [751-800] [801-850] [851-900]
[901-950] [951-1000] [1001-1050] [1051-1100] [1101-1150] [1151-1200]
[1201-1250] [1251-1300] [1301-1350] [1351-1400] [1401-1450] [1451-1500]
# Title Solution Difficulty
1 Two Sum Go Easy
2 Add Two Numbers Go Medium
3 Longest Substring Without Repeating Characters Go Medium
4 Median of Two Sorted Arrays Go Hard
5 Longest Palindromic Substring Go Medium
6 ZigZag Conversion Go Medium
7 Reverse Integer Go Easy
8 String to Integer (atoi) Go Medium
9 Palindrome Number Go Easy
10 Regular Expression Matching Go Hard
11 Container With Most Water Go Medium
12 Integer to Roman Go Medium
13 Roman to Integer Go Easy
14 Longest Common Prefix Go Easy
15 3Sum Go Medium
16 3Sum Closest Go Medium
17 Letter Combinations of a Phone Number Go Medium
18 4Sum Go Medium
19 Remove Nth Node From End of List Go Medium
20 Valid Parentheses Go Easy
21 Merge Two Sorted Lists Go Easy
22 Generate Parentheses Go Medium
23 Merge k Sorted Lists Go Hard
24 Swap Nodes in Pairs Go Medium
25 Reverse Nodes in k-Group Go Hard
26 Remove Duplicates from Sorted Array Go Easy
27 Remove Element Go Easy
28 Implement strStr() Go Easy
29 Divide Two Integers Go Medium
30 Substring with Concatenation of All Words Go Hard
31 Next Permutation Go Medium
32 Longest Valid Parentheses Go Hard
33 Search in Rotated Sorted Array Go Medium
34 Find First and Last Position of Element in Sorted Array Go Medium
35 Search Insert Position Go Easy
36 Valid Sudoku Go Medium
37 Sudoku Solver Go Hard
38 Count and Say Go Easy
39 Combination Sum Go Medium
40 Combination Sum II Go Medium
41 First Missing Positive Go Hard
42 Trapping Rain Water Go Hard
43 Multiply Strings Go Medium
44 Wildcard Matching Go Hard
45 Jump Game II Go Hard
46 Permutations Go Medium
47 Permutations II Go Medium
48 Rotate Image Go Medium
49 Group Anagrams Go Medium
50 Pow(x, n) Go Medium
51 N-Queens Go Hard
52 N-Queens II Go Hard
53 Maximum Subarray Go Easy
54 Spiral Matrix Go Medium
55 Jump Game Go Medium
56 Merge Intervals Go Medium
57 Insert Interval Go Hard
58 Length of Last Word Go Easy
59 Spiral Matrix II Go Medium
60 Permutation Sequence Go Medium
61 Rotate List Go Medium
62 Unique Paths Go Medium
63 Unique Paths II Go Medium
64 Minimum Path Sum Go Medium
65 Valid Number Go Hard
66 Plus One Go Easy
67 Add Binary Go Easy
68 Text Justification Go Hard
69 Sqrt(x) Go Easy
70 Climbing Stairs Go Easy
71 Simplify Path Go Medium
72 Edit Distance Go Hard
73 Set Matrix Zeroes Go Medium
74 Search a 2D Matrix Go Medium
75 Sort Colors Go Medium
76 Minimum Window Substring Go Hard
77 Combinations Go Medium
78 Subsets Go Medium
79 Word Search Go Medium
80 Remove Duplicates from Sorted Array II Go Medium
81 Search in Rotated Sorted Array II Go Medium
82 Remove Duplicates from Sorted List II Go Medium
83 Remove Duplicates from Sorted List Go Easy
84 Largest Rectangle in Histogram Go Hard
85 Maximal Rectangle Go Hard
86 Partition List Go Medium
87 Scramble String Go Hard
88 Merge Sorted Array Go Easy
89 Gray Code Go Medium
90 Subsets II Go Medium
91 Decode Ways Go Medium
92 Reverse Linked List II Go Medium
93 Restore IP Addresses Go Medium
94 Binary Tree Inorder Traversal Go Medium
95 Unique Binary Search Trees II Go Medium
96 Unique Binary Search Trees Go Medium
97 Interleaving String Go Hard
98 Validate Binary Search Tree Go Medium
99 Recover Binary Search Tree Go Hard
100 Same Tree Go Easy
101 Symmetric Tree Go Easy
102 Binary Tree Level Order Traversal Go Medium
103 Binary Tree Zigzag Level Order Traversal Go Medium
104 Maximum Depth of Binary Tree Go Easy
105 Construct Binary Tree from Preorder and Inorder Traversal Go Medium
106 Construct Binary Tree from Inorder and Postorder Traversal Go Medium
107 Binary Tree Level Order Traversal II Go Easy
108 Convert Sorted Array to Binary Search Tree Go Easy
109 Convert Sorted List to Binary Search Tree Go Medium
110 Balanced Binary Tree Go Easy
111 Minimum Depth of Binary Tree Go Easy
112 Path Sum Go Easy
113 Path Sum II Go Medium
114 Flatten Binary Tree to Linked List Go Medium
115 Distinct Subsequences Go Hard
116 Populating Next Right Pointers in Each Node Go Medium
117 Populating Next Right Pointers in Each Node II Go Medium
118 Pascal's Triangle Go Easy
119 Pascal's Triangle II Go Easy
120 Triangle Go Medium
121 Best Time to Buy and Sell Stock Go Easy
122 Best Time to Buy and Sell Stock II Go Easy
123 Best Time to Buy and Sell Stock III Go Hard
124 Binary Tree Maximum Path Sum Go Hard
125 Valid Palindrome Go Easy
126 Word Ladder II Go Hard
127 Word Ladder Go Medium
128 Longest Consecutive Sequence Go Hard
129 Sum Root to Leaf Numbers Go Medium
130 Surrounded Regions Go Medium
131 Palindrome Partitioning Go Medium
132 Palindrome Partitioning II Go Hard
133 Clone Graph Go Medium
134 Gas Station Go Medium
135 Candy Go Hard
136 Single Number Go Easy
137 Single Number II Go Medium
138 Copy List with Random Pointer Go Medium
139 Word Break Go Medium
140 Word Break II Go Hard
141 Linked List Cycle Go Easy
142 Linked List Cycle II Go Medium
143 Reorder List Go Medium
144 Binary Tree Preorder Traversal Go Medium
145 Binary Tree Postorder Traversal Go Hard
146 LRU Cache Go Medium
147 Insertion Sort List Go Medium
148 Sort List Go Medium
149 Max Points on a Line Go Hard
150 Evaluate Reverse Polish Notation Go Medium
151 Reverse Words in a String Go Medium
152 Maximum Product Subarray Go Medium
153 Find Minimum in Rotated Sorted Array Go Medium
154 Find Minimum in Rotated Sorted Array II Go Hard
155 Min Stack Go Easy
156 Binary Tree Upside Down 🔒 Go Medium
157 Read N Characters Given Read4 🔒 Go Easy
158 Read N Characters Given Read4 II - Call multiple times 🔒 Go Hard
159 Longest Substring with At Most Two Distinct Characters 🔒 Go Medium
160 Intersection of Two Linked Lists Go Easy
161 One Edit Distance 🔒 Go Medium
162 Find Peak Element Go Medium
163 Missing Ranges 🔒 Go Medium
164 Maximum Gap Go Hard
165 Compare Version Numbers Go Medium
166 Fraction to Recurring Decimal Go Medium
167 Two Sum II - Input array is sorted Go Easy
168 Excel Sheet Column Title Go Easy
169 Majority Element Go Easy
170 Two Sum III - Data structure design 🔒 Go Easy
171 Excel Sheet Column Number Go Easy
172 Factorial Trailing Zeroes Go Easy
173 Binary Search Tree Iterator Go Medium
174 Dungeon Game Go Hard
175 Combine Two Tables MySQL Easy
176 Second Highest Salary MySQL Easy
177 Nth Highest Salary MySQL Medium
178 Rank Scores MySQL Medium
179 Largest Number Go Medium
180 Consecutive Numbers MySQL Medium
181 Employees Earning More Than Their Managers MySQL Easy
182 Duplicate Emails MySQL Easy
183 Customers Who Never Order MySQL Easy
184 Department Highest Salary MySQL Medium
185 Department Top Three Salaries MySQL Hard
186 Reverse Words in a String II 🔒 Go Medium
187 Repeated DNA Sequences Go Medium
188 Best Time to Buy and Sell Stock IV Go Hard
189 Rotate Array Go Easy
190 Reverse Bits Go Easy
191 Number of 1 Bits Go Easy
192 Word Frequency Bash Medium
193 Valid Phone Numbers Bash Easy
194 Transpose File Bash Medium
195 Tenth Line Bash Easy
196 Delete Duplicate Emails MySQL Easy
197 Rising Temperature MySQL Easy
198 House Robber Go Easy
199 Binary Tree Right Side View Go Medium
200 Number of Islands Go Medium
201 Bitwise AND of Numbers Range Go Medium
202 Happy Number Go Easy
203 Remove Linked List Elements Go Easy
204 Count Primes Go Easy
205 Isomorphic Strings Go Easy
206 Reverse Linked List Go Easy
207 Course Schedule Go Medium
208 Implement Trie (Prefix Tree) Go Medium
209 Minimum Size Subarray Sum Go Medium
210 Course Schedule II Go Medium
211 Add and Search Word - Data structure design Go Medium
212 Word Search II Go Hard
213 House Robber II Go Medium
214 Shortest Palindrome Go Hard
215 Kth Largest Element in an Array Go Medium
216 Combination Sum III Go Medium
217 Contains Duplicate Go Easy
218 The Skyline Problem Go Hard
219 Contains Duplicate II Go Easy
220 Contains Duplicate III Go Medium
221 Maximal Square Go Medium
222 Count Complete Tree Nodes Go Medium
223 Rectangle Area Go Medium
224 Basic Calculator Go Hard
225 Implement Stack using Queues Go Easy
226 Invert Binary Tree Go Easy
227 Basic Calculator II Go Medium
228 Summary Ranges Go Medium
229 Majority Element II Go Medium
230 Kth Smallest Element in a BST Go Medium
231 Power of Two Go Easy
232 Implement Queue using Stacks Go Easy
233 Number of Digit One Go Hard
234 Palindrome Linked List Go Easy
235 Lowest Common Ancestor of a Binary Search Tree Go Easy
236 Lowest Common Ancestor of a Binary Tree Go Medium
237 Delete Node in a Linked List Go Easy
238 Product of Array Except Self Go Medium
239 Sliding Window Maximum Go Hard
240 Search a 2D Matrix II Go Medium
241 Different Ways to Add Parentheses Go Medium
242 Valid Anagram Go Easy
243 Shortest Word Distance 🔒 Go Easy
244 Shortest Word Distance II 🔒 Go Medium
245 Shortest Word Distance III 🔒 Go Medium
246 Strobogrammatic Number 🔒 Go Easy
247 Strobogrammatic Number II 🔒 Go Medium
248 Strobogrammatic Number III 🔒 Go Hard
249 Group Shifted Strings 🔒 Go Medium
250 Count Univalue Subtrees 🔒 Go Medium
251 Flatten 2D Vector 🔒 Go Medium
252 Meeting Rooms 🔒 Go Easy
253 Meeting Rooms II 🔒 Go Medium
254 Factor Combinations 🔒 Go Medium
255 Verify Preorder Sequence in Binary Search Tree 🔒 Go Medium
256 Paint House 🔒 Go Easy
257 Binary Tree Paths Go Easy
258 Add Digits Go Easy
259 3Sum Smaller 🔒 Go Medium
260 Single Number III Go Medium
261 Graph Valid Tree 🔒 Go Medium
262 Trips and Users MySQL Hard
263 Ugly Number Go Easy
264 Ugly Number II Go Medium
265 Paint House II 🔒 Go Hard
266 Palindrome Permutation 🔒 Go Easy
267 Palindrome Permutation II 🔒 Go Medium
268 Missing Number Go Easy
269 Alien Dictionary 🔒 Go Hard
270 Closest Binary Search Tree Value 🔒 Go Easy
271 Encode and Decode Strings 🔒 Go Medium
272 Closest Binary Search Tree Value II 🔒 Go Hard
273 Integer to English Words Go Hard
274 H-Index Go Medium
275 H-Index II Go Medium
276 Paint Fence 🔒 Go Easy
277 Find the Celebrity 🔒 Go Medium
278 First Bad Version Go Easy
279 Perfect Squares Go Medium
280 Wiggle Sort 🔒 Go Medium
281 Zigzag Iterator 🔒 Go Medium
282 Expression Add Operators Go Hard
283 Move Zeroes Go Easy
284 Peeking Iterator Go Medium
285 Inorder Successor in BST 🔒 Go Medium
286 Walls and Gates 🔒 Go Medium
287 Find the Duplicate Number Go Medium
288 Unique Word Abbreviation 🔒 Go Medium
289 Game of Life Go Medium
290 Word Pattern Go Easy
291 Word Pattern II 🔒 Go Hard
292 Nim Game Go Easy
293 Flip Game 🔒 Go Easy
294 Flip Game II 🔒 Go Medium
295 Find Median from Data Stream Go Hard
296 Best Meeting Point 🔒 Go Hard
297 Serialize and Deserialize Binary Tree Go Hard
298 Binary Tree Longest Consecutive Sequence 🔒 Go Medium
299 Bulls and Cows Go Easy
300 Longest Increasing Subsequence Go Medium