@@ -140,186 +140,9 @@ leetcode 题解,记录自己的 leetcode 解题之路。
140
140
141
141
> 这里仅列举具有** 代表性题目** ,并不是全部题目
142
142
143
- #### 简单难度
144
-
145
- - [ 0001.two-sum] ( ./problems/1.two-sum.md )
146
- - [ 0020.Valid Parentheses] ( ./problems/20.valid-parentheses.md )
147
- - [ 0021.MergeTwoSortedLists] ( ./problems/21.merge-two-sorted-lists.md )
148
- - [ 0026.remove-duplicates-from-sorted-array] ( ./problems/26.remove-duplicates-from-sorted-array.md )
149
- - [ 0053.maximum-sum-subarray] ( ./problems/53.maximum-sum-subarray-cn.md )
150
- - [ 0088.merge-sorted-array] ( ./problems/88.merge-sorted-array.md )
151
- - [ 0101.symmetric-tree] ( ./problems/101.symmetric-tree.md ) 🆕
152
- - [ 0104.maximum-depth-of-binary-tree] ( ./problems/104.maximum-depth-of-binary-tree.md )
153
- - [ 0108.convert-sorted-array-to-binary-search-tree] ( ./problems/108.convert-sorted-array-to-binary-search-tree.md )
154
- - [ 0121.best-time-to-buy-and-sell-stock] ( ./problems/121.best-time-to-buy-and-sell-stock.md )
155
- - [ 0122.best-time-to-buy-and-sell-stock-ii] ( ./problems/122.best-time-to-buy-and-sell-stock-ii.md )
156
- - [ 0125.valid-palindrome] ( ./problems/125.valid-palindrome.md )
157
- - [ 0136.single-number] ( ./problems/136.single-number.md )
158
- - [ 0155.min-stack] ( ./problems/155.min-stack.md ) 🆕
159
- - [ 0167.two-sum-ii-input-array-is-sorted] ( ./problems/167.two-sum-ii-input-array-is-sorted.md )
160
- - [ 0169.majority-element] ( ./problems/169.majority-element.md )
161
- - [ 0172.factorial-trailing-zeroes] ( ./problems/172.factorial-trailing-zeroes.md )
162
- - [ 0190.reverse-bits] ( ./problems/190.reverse-bits.md )
163
- - [ 0191.number-of-1-bits] ( ./problems/191.number-of-1-bits.md )
164
- - [ 0198.house-robber] ( ./problems/198.house-robber.md )
165
- - [ 0203.remove-linked-list-elements] ( ./problems/203.remove-linked-list-elements.md )
166
- - [ 0206.reverse-linked-list] ( ./problems/206.reverse-linked-list.md )
167
- - [ 0219.contains-duplicate-ii] ( ./problems/219.contains-duplicate-ii.md )
168
- - [ 0226.invert-binary-tree] ( ./problems/226.invert-binary-tree.md )
169
- - [ 0232.implement-queue-using-stacks] ( ./problems/232.implement-queue-using-stacks.md ) 🆕
170
- - [ 0263.ugly-number] ( ./problems/263.ugly-number.md )
171
- - [ 0283.move-zeroes] ( ./problems/283.move-zeroes.md )
172
- - [ 0342.power-of-four] ( ./problems/342.power-of-four.md )
173
- - [ 0349.intersection-of-two-arrays] ( ./problems/349.intersection-of-two-arrays.md )
174
- - [ 0371.sum-of-two-integers] ( ./problems/371.sum-of-two-integers.md )
175
- - [ 0437.path-sum-iii] ( ./problems/437.path-sum-iii.md ) 🆕
176
- - [ 0455.AssignCookies] ( ./problems/455.AssignCookies.md ) 🆕
177
- - [ 0501.find-mode-in-binary-search-tree] ( ./problems/501.Find-Mode-in-Binary-Search-Tree.md ) 🆕
178
- - [ 0575.distribute-candies] ( ./problems/575.distribute-candies.md )
179
- - [ 0874.walking-robot-simulation] ( ./problems/874.walking-robot-simulation.md ) 🆕
180
- - [ 1260.shift-2d-grid] ( ./problems/1260.shift-2d-grid.md ) 🆕
181
- - [ 1332.remove-palindromic-subsequences] ( ./problems/1332.remove-palindromic-subsequences.md ) 🆕
182
-
183
- #### 中等难度
184
-
185
- - [ 0002.add-two-numbers] ( ./problems/2.add-two-numbers.md )
186
- - [ 0003.longest-substring-without-repeating-characters] ( ./problems/3.longest-substring-without-repeating-characters.md )
187
- - [ 0005.longest-palindromic-substring] ( ./problems/5.longest-palindromic-substring.md )
188
- - [ 0011.container-with-most-water] ( ./problems/11.container-with-most-water.md )
189
- - [ 0015.3-sum] ( ./problems/15.3-sum.md )
190
- - [ 0017.Letter-Combinations-of-a-Phone-Number] ( ./problems/17.Letter-Combinations-of-a-Phone-Number.md ) 🆕
191
- - [ 0019. Remove Nth Node From End of List] ( ./problems/19.removeNthNodeFromEndofList.md )
192
- - [ 0022.generate-parentheses.md] ( ./problems/22.generate-parentheses.md ) 🆕
193
- - [ 0024. Swap Nodes In Pairs] ( ./problems/24.swapNodesInPairs.md )
194
- - [ 0029.divide-two-integers] ( ./problems/29.divide-two-integers.md )
195
- - [ 0031.next-permutation] ( ./problems/31.next-permutation.md )
196
- - [ 0033.search-in-rotated-sorted-array] ( ./problems/33.search-in-rotated-sorted-array.md )
197
- - [ 0039.combination-sum] ( ./problems/39.combination-sum.md )
198
- - [ 0040.combination-sum-ii] ( ./problems/40.combination-sum-ii.md )
199
- - [ 0046.permutations] ( ./problems/46.permutations.md )
200
- - [ 0047.permutations-ii] ( ./problems/47.permutations-ii.md )
201
- - [ 0048.rotate-image] ( ./problems/48.rotate-image.md )
202
- - [ 0049.group-anagrams] ( ./problems/49.group-anagrams.md )
203
- - [ 0050.pow-x-n] ( ./problems/50.pow-x-n.md ) 🆕
204
- - [ 0055.jump-game] ( ./problems/55.jump-game.md )
205
- - [ 0056.merge-intervals] ( ./problems/56.merge-intervals.md )
206
- - [ 0060.permutation-sequence] ( ./problems/60.permutation-sequence.md ) 🆕
207
- - [ 0062.unique-paths] ( ./problems/62.unique-paths.md ) 🖊
208
- - [ 0073.set-matrix-zeroes] ( ./problems/73.set-matrix-zeroes.md )
209
- - [ 0075.sort-colors] ( ./problems/75.sort-colors.md )
210
- - [ 0078.subsets] ( ./problems/78.subsets.md )
211
- - [ 0079.word-search] ( ./problems/79.word-search-en.md )
212
- - [ 0080.remove-duplicates-from-sorted-array-ii] ( ./problems/80.remove-duplicates-from-sorted-array-ii.md ) 🆕
213
- - [ 0086.partition-list] ( ./problems/86.partition-list.md )
214
- - [ 0090.subsets-ii] ( ./problems/90.subsets-ii.md )
215
- - [ 0091.decode-ways] ( ./problems/91.decode-ways.md )
216
- - [ 0092.reverse-linked-list-ii] ( ./problems/92.reverse-linked-list-ii.md ) 🖊
217
- - [ 0094.binary-tree-inorder-traversal] ( ./problems/94.binary-tree-inorder-traversal.md )
218
- - [ 0095.unique-binary-search-trees-ii] ( ./problems/95.unique-binary-search-trees-ii.md ) 🆕
219
- - [ 0096.unique-binary-search-trees] ( ./problems/96.unique-binary-search-trees.md ) 🆕
220
- - [ 0098.validate-binary-search-tree] ( ./problems/98.validate-binary-search-tree.md )
221
- - [ 0102.binary-tree-level-order-traversal] ( ./problems/102.binary-tree-level-order-traversal.md )
222
- - [ 0103.binary-tree-zigzag-level-order-traversal] ( ./problems/103.binary-tree-zigzag-level-order-traversal.md )
223
- - [ 105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md] ( ./problems/105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md )
224
- - [ 0113.path-sum-ii] ( ./problems/113.path-sum-ii.md )
225
- - [ 0129.sum-root-to-leaf-numbers] ( ./problems/129.sum-root-to-leaf-numbers.md )
226
- - [ 0130.surrounded-regions] ( ./problems/130.surrounded-regions.md )
227
- - [ 0131.palindrome-partitioning] ( ./problems/131.palindrome-partitioning.md )
228
- - [ 0139.word-break] ( ./problems/139.word-break.md )
229
- - [ 0144.binary-tree-preorder-traversal] ( ./problems/144.binary-tree-preorder-traversal.md )
230
- - [ 0150.evaluate-reverse-polish-notation] ( ./problems/150.evaluate-reverse-polish-notation.md )
231
- - [ 0152.maximum-product-subarray] ( ./problems/152.maximum-product-subarray.md ) 🖊
232
- - [ 0199.binary-tree-right-side-view] ( ./problems/199.binary-tree-right-side-view.md )
233
- - [ 0200.number-of-islands] ( ./problems/200.number-of-islands.md ) 🆕
234
- - [ 0201.bitwise-and-of-numbers-range] ( ./problems/201.bitwise-and-of-numbers-range.md ) 🖊
235
- - [ 0208.implement-trie-prefix-tree] ( ./problems/208.implement-trie-prefix-tree.md )
236
- - [ 0209.minimum-size-subarray-sum] ( ./problems/209.minimum-size-subarray-sum.md )
237
- - [ 0211.add-and-search-word-data-structure-design] ( ./problems/211.add-and-search-word-data-structure-design.md ) 🆕
238
- - [ 0215.kth-largest-element-in-an-array] ( ./problems/215.kth-largest-element-in-an-array.md ) 🆕
239
- - [ 0221.maximal-square] ( ./problems/221.maximal-square.md )
240
- - [ 0229.majority-element-ii] ( ./problems/229.majority-element-ii.md ) 🆕
241
- - [ 0230.kth-smallest-element-in-a-bst] ( ./problems/230.kth-smallest-element-in-a-bst.md )
242
- - [ 0236.lowest-common-ancestor-of-a-binary-tree] ( ./problems/236.lowest-common-ancestor-of-a-binary-tree.md )
243
- - [ 0238.product-of-array-except-self] ( ./problems/238.product-of-array-except-self.md )
244
- - [ 0240.search-a-2-d-matrix-ii] ( ./problems/240.search-a-2-d-matrix-ii.md )
245
- - [ 0279.perfect-squares] ( ./problems/279.perfect-squares.md )
246
- - [ 0309.best-time-to-buy-and-sell-stock-with-cooldown] ( ./problems/309.best-time-to-buy-and-sell-stock-with-cooldown.md )
247
- - [ 0322.coin-change] ( ./problems/322.coin-change.md )
248
- - [ 0328.odd-even-linked-list] ( ./problems/328.odd-even-linked-list.md )
249
- - [ 0334.increasing-triplet-subsequence] ( ./problems/334.increasing-triplet-subsequence.md )
250
- - [ 0337.house-robber-iii.md] ( ./problems/337.house-robber-iii.md )
251
- - [ 0343.integer-break] ( ./problems/343.integer-break.md ) 🆕
252
- - [ 0365.water-and-jug-problem] ( ./problems/365.water-and-jug-problem.md )
253
- - [ 0378.kth-smallest-element-in-a-sorted-matrix] ( ./problems/378.kth-smallest-element-in-a-sorted-matrix.md )
254
- - [ 0380.insert-delete-getrandom-o1] ( ./problems/380.insert-delete-getrandom-o1.md )
255
- - [ 0416.partition-equal-subset-sum] ( ./problems/416.partition-equal-subset-sum.md ) 🖊
256
- - [ 0445.add-two-numbers-ii] ( ./problems/445.add-two-numbers-ii.md )
257
- - [ 0454.4-sum-ii] ( ./problems/454.4-sum-ii.md )
258
- - [ 0474.ones-and-zeros] ( ./problems/474.ones-and-zeros-en.md )
259
- - [ 0494.target-sum] ( ./problems/494.target-sum.md )
260
- - [ 0516.longest-palindromic-subsequence] ( ./problems/516.longest-palindromic-subsequence.md )
261
- - [ 0518.coin-change-2] ( ./problems/518.coin-change-2.md )
262
- - [ 0547.friend-circles] ( ./problems/547.friend-circles-en.md )
263
- - [ 0560.subarray-sum-equals-k] ( ./problems/560.subarray-sum-equals-k.md )
264
- - [ 0609.find-duplicate-file-in-system] ( ./problems/609.find-duplicate-file-in-system.md )
265
- - [ 0611.valid-triangle-number] ( ./problems/611.valid-triangle-number.md )
266
- - [ 0718.maximum-length-of-repeated-subarray] ( ./problems/718.maximum-length-of-repeated-subarray.md )
267
- - [ 0785.is-graph-bipartite] ( ./problems/785.is-graph-bipartite.md ) 🆕
268
- - [ 0820.short-encoding-of-words] ( ./problems/820.short-encoding-of-words.md ) 🖊
269
- - [ 0875.koko-eating-bananas] ( ./problems/875.koko-eating-bananas.md )
270
- - [ 0877.stone-game] ( ./problems/877.stone-game.md )
271
- - [ 0886.possible-bipartition] ( ./problems/886.possible-bipartition.md ) 🆕
272
- - [ 0900.rle-iterator] ( ./problems/900.rle-iterator.md )
273
- - [ 0912.sort-an-array] ( ./problems/912.sort-an-array.md )
274
- - [ 0935.knight-dialer] ( ./problems/935.knight-dialer.md ) 🆕
275
- - [ 1011.capacity-to-ship-packages-within-d-days] ( ./problems/1011.capacity-to-ship-packages-within-d-days.md )
276
- - [ 1014.best-sightseeing-pair] ( ./problems/1014.best-sightseeing-pair.md ) 🆕
277
- - [ 1015.smallest-integer-divisible-by-k] ( ./problems/1015.smallest-integer-divisible-by-k.md )
278
- - [ 1019.next-greater-node-in-linked-list] ( ./problems/1019.next-greater-node-in-linked-list.md ) 🆕
279
- - [ 1020.number-of-enclaves] ( ./problems/1020.number-of-enclaves.md )
280
- - [ 1023.camelcase-matching] ( ./problems/1023.camelcase-matching.md )
281
- - [ 1031.maximum-sum-of-two-non-overlapping-subarrays] ( ./problems/1031.maximum-sum-of-two-non-overlapping-subarrays.md )
282
- - [ 1104.path-in-zigzag-labelled-binary-tree] ( ./problems/1104.path-in-zigzag-labelled-binary-tree.md )
283
- - [ 1131.maximum-of-absolute-value-expression] ( ./problems/1131.maximum-of-absolute-value-expression.md )
284
- - [ 1186.maximum-subarray-sum-with-one-deletion] ( ./problems/1186.maximum-subarray-sum-with-one-deletion.md ) 🆕
285
- - [ 1218.longest-arithmetic-subsequence-of-given-difference] ( ./problems/1218.longest-arithmetic-subsequence-of-given-difference.md )
286
- - [ 1227.airplane-seat-assignment-probability] ( ./problems/1227.airplane-seat-assignment-probability.md )
287
- - [ 1261.find-elements-in-a-contaminated-binary-tree] ( ./problems/1261.find-elements-in-a-contaminated-binary-tree.md )
288
- - [ 1262.greatest-sum-divisible-by-three] ( ./problems/1262.greatest-sum-divisible-by-three.md )
289
- - [ 1297.maximum-number-of-occurrences-of-a-substring] ( ./problems/1297.maximum-number-of-occurrences-of-a-substring.md )
290
- - [ 1310.xor-queries-of-a-subarray] ( ./problems/1310.xor-queries-of-a-subarray.md ) 🆕
291
- - [ 1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance] ( ./problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md ) 🆕
292
- - [ 1371.find-the-longest-substring-containing-vowels-in-even-counts] ( ./problems/1371.find-the-longest-substring-containing-vowels-in-even-counts.md ) 🆕
293
-
294
- #### 困难难度
295
-
296
- - [ 0004.median-of-two-sorted-array] ( ./problems/4.median-of-two-sorted-array.md )
297
- - [ 0023.merge-k-sorted-lists] ( ./problems/23.merge-k-sorted-lists.md )
298
- - [ 0025.reverse-nodes-in-k-group] ( ./problems/25.reverse-nodes-in-k-groups-cn.md )
299
- - [ 0030.substring-with-concatenation-of-all-words] ( ./problems/30.substring-with-concatenation-of-all-words.md )
300
- - [ 0032.longest-valid-parentheses] ( ./problems/32.longest-valid-parentheses.md )
301
- - [ 0042.trapping-rain-water] ( ./problems/42.trapping-rain-water.md ) 🖊
302
- - [ 0052.N-Queens-II] ( ./problems/52.N-Queens-II.md )
303
- - [ 0084.largest-rectangle-in-histogram] ( ./problems/84.largest-rectangle-in-histogram.md )
304
- - [ 0085.maximal-rectangle] ( ./problems/85.maximal-rectangle.md )
305
- - [ 0124.binary-tree-maximum-path-sum] ( ./problems/124.binary-tree-maximum-path-sum.md )
306
- - [ 0128.longest-consecutive-sequence] ( ./problems/128.longest-consecutive-sequence.md )
307
- - [ 0145.binary-tree-postorder-traversal] ( ./problems/145.binary-tree-postorder-traversal.md )
308
- - [ 0212.word-search-ii] ( ./problems/212.word-search-ii.md )
309
- - [ 0239.sliding-window-maximum] ( ./problems/239.sliding-window-maximum.md )
310
- - [ 0295.find-median-from-data-stream] ( ./problems/295.find-median-from-data-stream.md )
311
- - [ 0301.remove-invalid-parentheses] ( ./problems/301.remove-invalid-parentheses.md )
312
- - [ 0312.burst-balloons] ( ./problems/312.burst-balloons.md ) 🆕
313
- - [ 0335.self-crossPing] ( ./problems/335.self-crossing.md )
314
- - [ 0460.lfu-cache] ( ./problems/460.lfu-cache.md )
315
- - [ 0472.concatenated-words] ( ./problems/472.concatenated-words.md ) 🆕
316
- - [ 0493.reverse-pairs] ( ./problems/493.reverse-pairs.md ) 🆕
317
- - [ 0887.super-egg-drop] ( ./problems/887.super-egg-drop.md )
318
- - [ 0895.maximum-frequency-stack] ( ./problems/895.maximum-frequency-stack.md ) 🆕
319
-
320
- - [ 1032.stream-of-characters] ( ./problems/1032.stream-of-characters.md ) 🆕
321
- - [ 1168.optimize-water-distribution-in-a-village] ( ./problems/1168.optimize-water-distribution-in-a-village-cn.md ) 🆕
322
- - [ 1449.form-largest-integer-with-digits-that-add-up-to-target] ( ./problems/1449.form-largest-integer-with-digits-that-add-up-to-target.md ) 🆕
143
+ - [ 简单难度] ( ./collections/easy.md )
144
+ - [ 中等难度] ( ./collections/medium.md )
145
+ - [ 困难难度] ( ./collections/hard.md )
323
146
324
147
### 数据结构与算法的总结
325
148
0 commit comments