@@ -85,7 +85,6 @@ leetcode 题解,记录自己的 leetcode 解题之路。
85
85
86
86
## :meat_on_bone : 仓库食用指南
87
87
88
- - 对于最近添加的部分, 后面会有 🆕 标注
89
88
- 对于最近更新的部分, 后面会有 🖊 标注
90
89
- 这里有一张互联网公司面试中经常考察的问题类型总结的思维导图,我们可以结合图片中的信息分析一下。
91
90
@@ -116,11 +115,11 @@ leetcode 题解,记录自己的 leetcode 解题之路。
116
115
- [ 链表专题] ( ./thinkings/linked-list.md )
117
116
- [ 树专题] ( ./thinkings/tree.md )
118
117
- [ 堆专题(上)] ( ./thinkings/heap.md )
119
- - [ 堆专题(下)] ( ./thinkings/heap-2.md ) 🆕
120
- - [ 二分专题(上)] ( ./thinkings/binary-search-1.md ) 🆕
121
- - [ 二分专题(下)] ( ./thinkings/binary-search-2.md ) 🆕
118
+ - [ 堆专题(下)] ( ./thinkings/heap-2.md )
119
+ - [ 二分专题(上)] ( ./thinkings/binary-search-1.md )
120
+ - [ 二分专题(下)] ( ./thinkings/binary-search-2.md )
122
121
<!-- - [基础算法](./thinkings/basic-algorithm.md) -->
123
- - [ 动态规划(重置版)] ( ./thinkings/dynamic-programming.md ) 🆕
122
+ - [ 动态规划(重置版)] ( ./thinkings/dynamic-programming.md )
124
123
- [ 二叉树的遍历] ( ./thinkings/binary-tree-traversal.md )
125
124
- [ 回溯] ( ./thinkings/backtrack.md )
126
125
- [ 哈夫曼编码和游程编码] ( ./thinkings/run-length-encode-and-huffman-encode.md )
@@ -134,8 +133,8 @@ leetcode 题解,记录自己的 leetcode 解题之路。
134
133
- [ 最大公约数] ( ./thinkings/GCD.md )
135
134
- [ 并查集] ( ./thinkings/union-find.md )
136
135
- [ 平衡二叉树专题] ( ./thinkings/balanced-tree.md )
137
- - [ 蓄水池抽样] ( ./thinkings/reservoid-sampling.md ) 🆕
138
- - [ 单调栈] ( ./thinkings/monotone-stack.md ) 🆕
136
+ - [ 蓄水池抽样] ( ./thinkings/reservoid-sampling.md )
137
+ - [ 单调栈] ( ./thinkings/monotone-stack.md )
139
138
140
139
## 精选题解
141
140
@@ -215,12 +214,12 @@ leetcode 题解,记录自己的 leetcode 解题之路。
215
214
- [ 401. 二进制手表] ( ./problems/401.binary-watch.md )
216
215
- [ 0437. 路径总和 III] ( ./problems/437.path-sum-iii.md )
217
216
- [ 0455. 分发饼干] ( ./problems/455.AssignCookies.md )
218
- - [ 0504. 七进制数] ( ./problems/504.base-7.md ) 🆕
217
+ - [ 0504. 七进制数] ( ./problems/504.base-7.md )
219
218
- [ 0575. 分糖果] ( ./problems/575.distribute-candies.md )
220
- - [ 0665. 非递减数列] ( ./problems/665.non-decreasing-array.md ) 🆕
219
+ - [ 0665. 非递减数列] ( ./problems/665.non-decreasing-array.md )
221
220
- [ 821. 字符的最短距离] ( ./problems/821.shortest-distance-to-a-character.md ) 91
222
221
- [ 0874. 模拟行走机器人] ( ./problems/874.walking-robot-simulation.md )
223
- - [ 1128. 等价多米诺骨牌对的数量] ( ./problems/1128.number-of-equivalent-domino-pairs.md ) 🆕
222
+ - [ 1128. 等价多米诺骨牌对的数量] ( ./problems/1128.number-of-equivalent-domino-pairs.md )
224
223
- [ 1260. 二维网格迁移] ( ./problems/1260.shift-2d-grid.md )
225
224
- [ 1332. 删除回文子序列] ( ./problems/1332.remove-palindromic-subsequences.md )
226
225
@@ -234,14 +233,15 @@ leetcode 题解,记录自己的 leetcode 解题之路。
234
233
235
234
- [ 面试题 17.09. 第 k 个数] ( ./problems/get-kth-magic-number-lcci.md )
236
235
- [ 面试题 17.23. 最大黑方阵] ( ./problems/max-black-square-lcci.md )
237
- - [ 面试题 16.16. 部分排序] ( ./problems/sub-sort-lcci.md ) 🆕
236
+ - [ 面试题 16.16. 部分排序] ( ./problems/sub-sort-lcci.md )
238
237
- [ Increasing Digits] ( ./problems/Increasing-Digits.md ) 👍
239
238
- [ Longest Contiguously Strictly Increasing Sublist After Deletion] ( ./problems/Longest-Contiguously-Strictly-Increasing-Sublist-After-Deletion.md ) 👍
240
- - [ Consecutive Wins] ( ./problems/consecutive-wins.md ) 🆕
241
- - [ Sort-String-by-Flipping] ( ./problems/Sort-String-by-Flipping.md ) 🆕
242
- - [ Number of Substrings with Single Character Difference] ( ./problems/Number-of-Substrings-with-Single-Character-Difference.md ) 🆕
243
- - [ Bus Fare] ( ./problems/Bus-Fare.md ) 🆕 👍
244
- - [ Minimum Dropping Path Sum] ( ./problems/Minimum-Dropping-Path-Sum.md ) 🆕
239
+ - [ Consecutive Wins] ( ./problems/consecutive-wins.md )
240
+ - [ Sort-String-by-Flipping] ( ./problems/Sort-String-by-Flipping.md )
241
+ - [ Number of Substrings with Single Character Difference] ( ./problems/Number-of-Substrings-with-Single-Character-Difference.md )
242
+ - [ Bus Fare] ( ./problems/Bus-Fare.md ) 👍
243
+ - [ Minimum Dropping Path Sum] ( ./problems/Minimum-Dropping-Path-Sum.md )
244
+ - [ Longest-Matrix-Path-Length] ( ./problems/Longest-Matrix-Path-Length.md )
245
245
246
246
- [ 0002. 两数相加] ( ./problems/2.add-two-numbers.md )
247
247
- [ 0003. 无重复字符的最长子串] ( ./problems/3.longest-substring-without-repeating-characters.md )
@@ -288,10 +288,10 @@ leetcode 题解,记录自己的 leetcode 解题之路。
288
288
- [ 0131. 分割回文串] ( ./problems/131.palindrome-partitioning.md )
289
289
- [ 0139. 单词拆分] ( ./problems/139.word-break.md )
290
290
- [ 0144. 二叉树的前序遍历] ( ./problems/144.binary-tree-preorder-traversal.md )
291
- - [ 0147. 对链表进行插入排序] ( ./problems/147.insertion-sort-list.md ) 🆕
291
+ - [ 0147. 对链表进行插入排序] ( ./problems/147.insertion-sort-list.md )
292
292
- [ 0150. 逆波兰表达式求值] ( ./problems/150.evaluate-reverse-polish-notation.md )
293
293
- [ 0152. 乘积最大子数组] ( ./problems/152.maximum-product-subarray.md )
294
- - [ 0153. 寻找旋转排序数组中的最小值] ( ./problems/153.find-minimum-in-rotated-sorted-array.md ) 🆕
294
+ - [ 0153. 寻找旋转排序数组中的最小值] ( ./problems/153.find-minimum-in-rotated-sorted-array.md )
295
295
- [ 0199. 二叉树的右视图] ( ./problems/199.binary-tree-right-side-view.md ) 👍
296
296
- [ 0200. 岛屿数量] ( ./problems/200.number-of-islands.md ) 👍
297
297
- [ 0201. 数字范围按位与] ( ./problems/201.bitwise-and-of-numbers-range.md )
@@ -321,17 +321,17 @@ leetcode 题解,记录自己的 leetcode 解题之路。
321
321
- [ 0394. 字符串解码] ( ./problems/394.decode-string.md ) 91
322
322
- [ 0416. 分割等和子集] ( ./problems/416.partition-equal-subset-sum.md )
323
323
- [ 0424. 替换后的最长重复字符] ( ./problems/424.longest-repeating-character-replacement.md )
324
- - [ 0438. 找到字符串中所有字母异位词] ( ./problems/438.find-all-anagrams-in-a-string.md ) 🆕
324
+ - [ 0438. 找到字符串中所有字母异位词] ( ./problems/438.find-all-anagrams-in-a-string.md )
325
325
- [ 0445. 两数相加 II] ( ./problems/445.add-two-numbers-ii.md )
326
326
- [ 0454. 四数相加 II] ( ./problems/454.4-sum-ii.md )
327
- - [ 0456. 132 模式] ( ./problems/456.132-pattern.md ) 🆕
327
+ - [ 0456. 132 模式] ( ./problems/456.132-pattern.md )
328
328
- [ 0464. 我能赢么] ( ./problems/464.can-i-win.md )
329
- - [ 0473. 火柴拼正方形] ( ./problems/473.matchsticks-to-square.md ) 🆕 👍
329
+ - [ 0473. 火柴拼正方形] ( ./problems/473.matchsticks-to-square.md ) 👍
330
330
- [ 0494. 目标和] ( ./problems/494.target-sum.md )
331
331
- [ 0516. 最长回文子序列] ( ./problems/516.longest-palindromic-subsequence.md )
332
332
- [ 0513. 找树左下角的值] ( ./problems/513.find-bottom-left-tree-value.md ) 91
333
333
- [ 0518. 零钱兑换 II] ( ./problems/518.coin-change-2.md )
334
- - [ 0525. 连续数组] ( ./problems/525.contiguous-array.md ) 🆕
334
+ - [ 0525. 连续数组] ( ./problems/525.contiguous-array.md )
335
335
- [ 0547. 朋友圈] ( ./problems/547.friend-circles.md )
336
336
- [ 0560. 和为 K 的子数组] ( ./problems/560.subarray-sum-equals-k.md )
337
337
- [ 0609. 在系统中查找重复文件] ( ./problems/609.find-duplicate-file-in-system.md )
@@ -340,15 +340,15 @@ leetcode 题解,记录自己的 leetcode 解题之路。
340
340
- [ 0686. 重复叠加字符串匹配] ( ./problems/686.repeated-string-match.md )
341
341
- [ 0718. 最长重复子数组] ( ./problems/718.maximum-length-of-repeated-subarray.md )
342
342
- [ 0714. 买卖股票的最佳时机含手续费] ( ./problems/714.best-time-to-buy-and-sell-stock-with-transaction-fee.md )
343
- - [ 0735. 行星碰撞] ( ./problems/735.asteroid-collision.md ) 🆕
343
+ - [ 0735. 行星碰撞] ( ./problems/735.asteroid-collision.md )
344
344
- [ 0754. 到达终点数字] ( ./problems/754.reach-a-number.md )
345
345
- [ 0785. 判断二分图] ( ./problems/785.is-graph-bipartite.md )
346
346
- [ 0790. 多米诺和托米诺平铺] ( ./problems/790.domino-and-tromino-tiling.md )
347
- - [ 0799. 香槟塔] ( ./problems/799.champagne-tower.md ) 🆕
347
+ - [ 0799. 香槟塔] ( ./problems/799.champagne-tower.md )
348
348
- [ 0801. 使序列递增的最小交换次数] ( ./problems/801.minimum-swaps-to-make-sequences-increasing.md )
349
349
- [ 0816. 模糊坐标] ( ./problems/816.ambiguous-coordinates.md )
350
350
- [ 0820. 单词的压缩编码] ( ./problems/820.short-encoding-of-words.md )
351
- - [ 0873. 最长的斐波那契子序列的长度] ( ./problems/873.length-of-longest-fibonacci-subsequence.md ) 🆕
351
+ - [ 0873. 最长的斐波那契子序列的长度] ( ./problems/873.length-of-longest-fibonacci-subsequence.md )
352
352
- [ 0875. 爱吃香蕉的珂珂] ( ./problems/875.koko-eating-bananas.md )
353
353
- [ 0877. 石子游戏] ( ./problems/877.stone-game.md )
354
354
- [ 0886. 可能的二分法] ( ./problems/886.possible-bipartition.md )
@@ -384,15 +384,15 @@ leetcode 题解,记录自己的 leetcode 解题之路。
384
384
- [ 1334. 阈值距离内邻居最少的城市] ( ./problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md )
385
385
- [ 1371.每个元音包含偶数次的最长子字符串] ( ./problems/1371.find-the-longest-substring-containing-vowels-in-even-counts.md )
386
386
- [ 1381. 设计一个支持增量操作的栈] ( ./problems/1381.design-a-stack-with-increment-operation.md ) 91
387
- - [ 1423. 可获得的最大点数] ( ./problems/1423.maximum-points-you-can-obtain-from-cards.md ) 🆕
387
+ - [ 1423. 可获得的最大点数] ( ./problems/1423.maximum-points-you-can-obtain-from-cards.md )
388
388
- [ 1438. 绝对差不超过限制的最长连续子数组] ( ./problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit.md )
389
389
- [ 1558. 得到目标数组的最少函数调用次数] ( ./problems/1558.minimum-numbers-of-function-calls-to-make-target-array.md )
390
390
- [ 1574. 删除最短的子数组使剩余数组有序] ( ./problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted.md )
391
391
- [ 1631. 最小体力消耗路径] ( ./problems/1631.path-with-minimum-effort.md )
392
- - [ 1658. 将 x 减到 0 的最小操作数] ( ./problems/1658.minimum-operations-to-reduce-x-to-zero.md ) 🆕
393
- - [ 1697. 检查边长度限制的路径是否存在] ( ./problems/1697.checking-existence-of-edge-length-limited-paths.md ) 🆕
394
- - [ 1737. 满足三条件之一需改变的最少字符数] ( ./problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions.md ) 🆕
395
- - [ 1834. 单线程 CPU] ( ./problems/1834.single-threaded-cpu.md ) 🆕
392
+ - [ 1658. 将 x 减到 0 的最小操作数] ( ./problems/1658.minimum-operations-to-reduce-x-to-zero.md )
393
+ - [ 1697. 检查边长度限制的路径是否存在] ( ./problems/1697.checking-existence-of-edge-length-limited-paths.md )
394
+ - [ 1737. 满足三条件之一需改变的最少字符数] ( ./problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions.md )
395
+ - [ 1834. 单线程 CPU] ( ./problems/1834.single-threaded-cpu.md )
396
396
397
397
### 困难难度题目合集
398
398
@@ -420,13 +420,14 @@ leetcode 题解,记录自己的 leetcode 解题之路。
420
420
421
421
以下是我列举的经典题目(带 91 字样的表示出自 ** 91 天学算法** 活动):
422
422
423
- - [ LCP 20. 快速公交] ( ./problems/lcp20.meChtZ.md ) 🆕
424
- - [ LCP 21. 追逐游戏] ( ./problems/lcp21.Za25hA.md ) 🆕 👍
425
- - [ Number Stream to Intervals] ( ./problems/Number-Stream-to-Intervals.md ) 🆕
423
+ - [ LCP 20. 快速公交] ( ./problems/lcp20.meChtZ.md )
424
+ - [ LCP 21. 追逐游戏] ( ./problems/lcp21.Za25hA.md ) 👍
425
+ - [ Number Stream to Intervals] ( ./problems/Number-Stream-to-Intervals.md )
426
426
- [ Triple Inversion] ( ./problems/Triple-Inversion.md ) 91
427
427
- [ Kth Pair Distance] ( ./problems/Kth-Pair-Distance.md ) 91
428
428
- [ Minimum Light Radius] ( ./problems/Minimum-Light-Radius.md ) 91
429
- - [ Largest Equivalent Set of Pairs] ( ./problems/Largest-Equivalent-Set-of-Pairs.md ) 🆕 👍
429
+ - [ Largest Equivalent Set of Pairs] ( ./problems/Largest-Equivalent-Set-of-Pairs.md ) 👍
430
+ - [ Ticket-Order.md] ( ./problemsTicket-Order.md )
430
431
431
432
- [ 0004. 寻找两个正序数组的中位数] ( ./problems/4.median-of-two-sorted-arrays.md ) 👍
432
433
- [ 0023. 合并 K 个升序链表] ( ./problems/23.merge-k-sorted-lists.md )
@@ -436,17 +437,17 @@ leetcode 题解,记录自己的 leetcode 解题之路。
436
437
- [ 0042. 接雨水] ( ./problems/42.trapping-rain-water.md )
437
438
- [ 0052. N 皇后 II] ( ./problems/52.N-Queens-II.md )
438
439
- [ 0057. 插入区间] ( problems/57.insert-interval.md )
439
- - [ 0065. 有效数字] ( problems/65.valid-number.md ) 🆕
440
+ - [ 0065. 有效数字] ( problems/65.valid-number.md )
440
441
- [ 0084. 柱状图中最大的矩形] ( ./problems/84.largest-rectangle-in-histogram.md )
441
442
- [ 0085. 最大矩形] ( ./problems/85.maximal-rectangle.md )
442
- - [ 0087. 扰乱字符串] ( ./problems/87.scramble-string.md ) 🆕
443
+ - [ 0087. 扰乱字符串] ( ./problems/87.scramble-string.md )
443
444
- [ 0124. 二叉树中的最大路径和] ( ./problems/124.binary-tree-maximum-path-sum.md )
444
445
- [ 0128. 最长连续序列] ( ./problems/128.longest-consecutive-sequence.md )
445
446
- [ 0132. 分割回文串 II] ( ./problems/132.palindrome-partitioning-ii.md ) 👍
446
447
- [ 0140. 单词拆分 II] ( problems/140.word-break-ii.md )
447
448
- [ 0145. 二叉树的后序遍历] ( ./problems/145.binary-tree-postorder-traversal.md )
448
449
- [ 0146. LRU 缓存机制] ( ./problems/146.lru-cache.md )
449
- - [ 0154. 寻找旋转排序数组中的最小值 II] ( ./problems/154.find-minimum-in-rotated-sorted-array-ii.md ) 🆕
450
+ - [ 0154. 寻找旋转排序数组中的最小值 II] ( ./problems/154.find-minimum-in-rotated-sorted-array-ii.md )
450
451
- [ 0212. 单词搜索 II] ( ./problems/212.word-search-ii.md )
451
452
- [ 0239. 滑动窗口最大值] ( ./problems/239.sliding-window-maximum.md ) 👍
452
453
- [ 0295. 数据流的中位数] ( ./problems/295.find-median-from-data-stream.md )
@@ -462,21 +463,21 @@ leetcode 题解,记录自己的 leetcode 解题之路。
462
463
- [ 0483. 最小好进制] ( ./problems/483.smallest-good-base.md )
463
464
- [ 0488. 祖玛游戏] ( ./problems/488.zuma-game.md )
464
465
- [ 0493. 翻转对] ( ./problems/493.reverse-pairs.md )
465
- - [ 0664. 奇怪的打印机] ( ./problems/664.strange-printer.md ) 🆕
466
- - [ 0679. 24 点游戏] ( ./problems/679.24-game.md ) 🆕
467
- - [ 0715. Range 模块] ( ./problems/715.range-module.md ) 🆕
466
+ - [ 0664. 奇怪的打印机] ( ./problems/664.strange-printer.md )
467
+ - [ 0679. 24 点游戏] ( ./problems/679.24-game.md )
468
+ - [ 0715. Range 模块] ( ./problems/715.range-module.md )
468
469
- [ 0768. 最多能完成排序的块 II] ( ./problems/768.max-chunks-to-make-sorted-ii.md ) 91
469
470
- [ 0805. 数组的均值分割] ( ./problems/805.split-array-with-same-average.md )
470
471
- [ 0839. 相似字符串组] ( ./problems/839.similar-string-groups.md )
471
472
- [ 0887. 鸡蛋掉落] ( ./problems/887.super-egg-drop.md )
472
473
- [ 0895. 最大频率栈] ( ./problems/895.maximum-frequency-stack.md )
473
- - [ 0909. 蛇梯棋] ( ./problems/909.snakes-and-ladders.md ) 🆕
474
- - [ 0975. 奇偶跳] ( ./problems/975.odd-even-jump.md ) 🆕
475
- - [ 0995. K 连续位的最小翻转次数] ( ./problems/995.minimum-number-of-k-consecutive-bit-flips.md ) 🆕
474
+ - [ 0909. 蛇梯棋] ( ./problems/909.snakes-and-ladders.md )
475
+ - [ 0975. 奇偶跳] ( ./problems/975.odd-even-jump.md )
476
+ - [ 0995. K 连续位的最小翻转次数] ( ./problems/995.minimum-number-of-k-consecutive-bit-flips.md )
476
477
- [ 1032. 字符流] ( ./problems/1032.stream-of-characters.md )
477
478
- [ 1168. 水资源分配优化] ( ./problems/1168.optimize-water-distribution-in-a-village.md )
478
479
- [ 1178. 猜字谜] ( ./problems/1178.number-of-valid-words-for-each-puzzle.md )
479
- - [ 1203. 项目管理] ( ./problems/1203.sort-items-by-groups-respecting-dependencies.md ) 🆕
480
+ - [ 1203. 项目管理] ( ./problems/1203.sort-items-by-groups-respecting-dependencies.md )
480
481
- [ 1255. 得分最高的单词集合] ( ./problems/1255.maximum-score-words-formed-by-letters.md )
481
482
- [ 1345. 跳跃游戏 IV] ( ./problems/1435.jump-game-iv.md )
482
483
- [ 1449. 数位成本和为目标值的最大数字] ( ./problems/1449.form-largest-integer-with-digits-that-add-up-to-target.md )
@@ -486,10 +487,10 @@ leetcode 题解,记录自己的 leetcode 解题之路。
486
487
- [ 1649. 通过指令创建有序数组] ( ./problems/1649.create-sorted-array-through-instructions.md )
487
488
- [ 1671. 得到山形数组的最少删除次数] ( ./problems/1671.minimum-number-of-removals-to-make-mountain-array.md )
488
489
- [ 1707. 与数组中元素的最大异或值] ( ./problems/5640.maximum-xor-with-an-element-from-array.md )
489
- - [ 1723. 完成所有工作的最短时间] ( ./problems/1723.find-minimum-time-to-finish-all-jobs.md ) 🆕
490
- - [ 1787. 使所有区间的异或结果为零] ( ./problems/1787.make-the-xor-of-all-segments-equal-to-zero.md ) 🆕
491
- - [ 1835. 所有数对按位与结果的异或和] ( ./problems/1835.find-xor-sum-of-all-pairs-bitwise-and.md ) 🆕
492
- - [ 5775. 准时抵达会议现场的最小跳过休息次数] ( ./problems/5775.minimum-skips-to-arrive-at-meeting-on-time.md ) 🆕
490
+ - [ 1723. 完成所有工作的最短时间] ( ./problems/1723.find-minimum-time-to-finish-all-jobs.md )
491
+ - [ 1787. 使所有区间的异或结果为零] ( ./problems/1787.make-the-xor-of-all-segments-equal-to-zero.md )
492
+ - [ 1835. 所有数对按位与结果的异或和] ( ./problems/1835.find-xor-sum-of-all-pairs-bitwise-and.md )
493
+ - [ 5775. 准时抵达会议现场的最小跳过休息次数] ( ./problems/5775.minimum-skips-to-arrive-at-meeting-on-time.md )
493
494
494
495
## :trident :   ; anki 卡片
495
496
0 commit comments