Skip to content

Commit f7a70a9

Browse files
committed
add some solutions
1 parent 796c013 commit f7a70a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3045
-133
lines changed

src/.vuepress/sidebar.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export default sidebar({
264264
"0354",
265265
"0355",
266266
"0366",
267+
"0367",
267268
"0369",
268269
"0373",
269270
"0374",
@@ -291,9 +292,11 @@ export default sidebar({
291292
"0432",
292293
"0433",
293294
"0435",
295+
"0436",
294296
"0437",
295297
"0438",
296298
"0440",
299+
"0441",
297300
"0442",
298301
"0443",
299302
"0445",
@@ -320,7 +323,9 @@ export default sidebar({
320323
"0514",
321324
"0516",
322325
"0518",
326+
"0528",
323327
"0530",
328+
"0540",
324329
"0543",
325330
"0547",
326331
"0557",
@@ -348,6 +353,7 @@ export default sidebar({
348353
"0643",
349354
"0649",
350355
"0654",
356+
"0658",
351357
"0662",
352358
"0670",
353359
"0678",
@@ -373,6 +379,7 @@ export default sidebar({
373379
"0731",
374380
"0735",
375381
"0739",
382+
"0744",
376383
"0746",
377384
"0763",
378385
"0772",
@@ -415,6 +422,7 @@ export default sidebar({
415422
"0958",
416423
"0962",
417424
"0973",
425+
"0981",
418426
"0986",
419427
"0994"
420428
]
@@ -440,6 +448,7 @@ export default sidebar({
440448
"1106",
441449
"1137",
442450
"1143",
451+
"1146",
443452
"1148",
444453
"1161",
445454
"1190"
@@ -464,6 +473,7 @@ export default sidebar({
464473
"1318",
465474
"1331",
466475
"1346",
476+
"1351",
467477
"1372",
468478
"1381"
469479
]
@@ -483,7 +493,8 @@ export default sidebar({
483493
"1472",
484494
"1475",
485495
"1493",
486-
"1497"
496+
"1497",
497+
"1498"
487498
]
488499
},
489500
{
@@ -493,6 +504,7 @@ export default sidebar({
493504
"1517",
494505
"1522",
495506
"1527",
507+
"1539",
496508
"1545",
497509
"1574",
498510
"1590",
@@ -611,9 +623,11 @@ export default sidebar({
611623
"2530",
612624
"2542",
613625
"2554",
626+
"2558",
614627
"2563",
615628
"2577",
616-
"2583"
629+
"2583",
630+
"2593"
617631
]
618632
},
619633
{
@@ -684,6 +698,7 @@ export default sidebar({
684698
"2757",
685699
"2758",
686700
"2759",
701+
"2762",
687702
"2774",
688703
"2775",
689704
"2776",
@@ -747,6 +762,7 @@ export default sidebar({
747762
"collapsible": true,
748763
"children": [
749764
"3309",
765+
"3311",
750766
"3318",
751767
"3319",
752768
"3321"

src/book/binary_search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function bsearch(arr, value) {
224224
| 162 | 寻找峰值 | [[]](/problem/0162.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟠 | [🀄️](https://leetcode.cn/problems/find-peak-element) [🔗](https://leetcode.com/problems/find-peak-element) |
225225
| 852 | 山脉数组的峰顶索引 | [[]](/problem/0852.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟠 | [🀄️](https://leetcode.cn/problems/peak-index-in-a-mountain-array) [🔗](https://leetcode.com/problems/peak-index-in-a-mountain-array) |
226226
| 1095 | 山脉数组中查找目标值 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`交互`](/tag/interactive.md) | 🔴 | [🀄️](https://leetcode.cn/problems/find-in-mountain-array) [🔗](https://leetcode.com/problems/find-in-mountain-array) |
227-
| 744 | 寻找比目标字母大的最小字母 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/find-smallest-letter-greater-than-target) [🔗](https://leetcode.com/problems/find-smallest-letter-greater-than-target) |
227+
| 744 | 寻找比目标字母大的最小字母 | [[]](/problem/0744.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/find-smallest-letter-greater-than-target) [🔗](https://leetcode.com/problems/find-smallest-letter-greater-than-target) |
228228
| 4 | 寻找两个正序数组的中位数 | [[]](/problem/0004.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`分治`](/tag/divide-and-conquer.md) | 🔴 | [🀄️](https://leetcode.cn/problems/median-of-two-sorted-arrays) [🔗](https://leetcode.com/problems/median-of-two-sorted-arrays) |
229229
| 74 | 搜索二维矩阵 | [[]](/problem/0074.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`矩阵`](/tag/matrix.md) | 🟠 | [🀄️](https://leetcode.cn/problems/search-a-2d-matrix) [🔗](https://leetcode.com/problems/search-a-2d-matrix) |
230230
| 240 | 搜索二维矩阵 II | [[]](/problem/0240.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`分治`](/tag/divide-and-conquer.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/search-a-2d-matrix-ii) [🔗](https://leetcode.com/problems/search-a-2d-matrix-ii) |
@@ -237,7 +237,7 @@ function bsearch(arr, value) {
237237
| 69 | x 的平方根 | [[]](/problem/0069.md) | [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/sqrtx) [🔗](https://leetcode.com/problems/sqrtx) |
238238
| 287 | 寻找重复数 | [[]](/problem/0287.md) | [`位运算`](/tag/bit-manipulation.md) [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/find-the-duplicate-number) [🔗](https://leetcode.com/problems/find-the-duplicate-number) |
239239
| 50 | Pow(x, n) | [[]](/problem/0050.md) | [`递归`](/tag/recursion.md) [`数学`](/tag/math.md) | 🟠 | [🀄️](https://leetcode.cn/problems/powx-n) [🔗](https://leetcode.com/problems/powx-n) |
240-
| 367 | 有效的完全平方数 | | [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/valid-perfect-square) [🔗](https://leetcode.com/problems/valid-perfect-square) |
240+
| 367 | 有效的完全平方数 | [[]](/problem/0367.md) | [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/valid-perfect-square) [🔗](https://leetcode.com/problems/valid-perfect-square) |
241241
| 1300 | 转变数组后最接近目标值的数组和 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`排序`](/tag/sorting.md) | 🟠 | [🀄️](https://leetcode.cn/problems/sum-of-mutated-array-closest-to-target) [🔗](https://leetcode.com/problems/sum-of-mutated-array-closest-to-target) |
242242
| 400 | 第 N 位数字 | [[]](/problem/0400.md) | [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) | 🟠 | [🀄️](https://leetcode.cn/problems/nth-digit) [🔗](https://leetcode.com/problems/nth-digit) |
243243

@@ -249,7 +249,7 @@ function bsearch(arr, value) {
249249
| 875 | 爱吃香蕉的珂珂 | [[]](/problem/0875.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟠 | [🀄️](https://leetcode.cn/problems/koko-eating-bananas) [🔗](https://leetcode.com/problems/koko-eating-bananas) |
250250
| 410 | 分割数组的最大值 | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/split-array-largest-sum) [🔗](https://leetcode.com/problems/split-array-largest-sum) |
251251
| 209 | 长度最小的子数组 | [[]](/problem/0209.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`前缀和`](/tag/prefix-sum.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/minimum-size-subarray-sum) [🔗](https://leetcode.com/problems/minimum-size-subarray-sum) |
252-
| 658 | 找到 K 个最接近的元素 | | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/find-k-closest-elements) [🔗](https://leetcode.com/problems/find-k-closest-elements) |
252+
| 658 | 找到 K 个最接近的元素 | [[]](/problem/0658.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/find-k-closest-elements) [🔗](https://leetcode.com/problems/find-k-closest-elements) |
253253
| 270 | 最接近的二叉搜索树值 🔒 | | [``](/tag/tree.md) [`深度优先搜索`](/tag/depth-first-search.md) [`二叉搜索树`](/tag/binary-search-tree.md) `2+` | 🟢 | [🀄️](https://leetcode.cn/problems/closest-binary-search-tree-value) [🔗](https://leetcode.com/problems/closest-binary-search-tree-value) |
254254
| 702 | 搜索长度未知的有序数组 🔒 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`交互`](/tag/interactive.md) | 🟠 | [🀄️](https://leetcode.cn/problems/search-in-a-sorted-array-of-unknown-size) [🔗](https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size) |
255255
| 349 | 两个数组的交集 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`双指针`](/tag/two-pointers.md) `2+` | 🟢 | [🀄️](https://leetcode.cn/problems/intersection-of-two-arrays) [🔗](https://leetcode.com/problems/intersection-of-two-arrays) |

src/book/two_pointer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
| 16 | 最接近的三数之和 | [[]](/problem/0016.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`排序`](/tag/sorting.md) | 🟠 | [🀄️](https://leetcode.cn/problems/3sum-closest) [🔗](https://leetcode.com/problems/3sum-closest) |
4141
| 18 | 四数之和 | [[]](/problem/0018.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`排序`](/tag/sorting.md) | 🟠 | [🀄️](https://leetcode.cn/problems/4sum) [🔗](https://leetcode.com/problems/4sum) |
4242
| 259 | 较小的三数之和 🔒 | [[]](/problem/0259.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/3sum-smaller) [🔗](https://leetcode.com/problems/3sum-smaller) |
43-
| 658 | 找到 K 个最接近的元素 | | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/find-k-closest-elements) [🔗](https://leetcode.com/problems/find-k-closest-elements) |
43+
| 658 | 找到 K 个最接近的元素 | [[]](/problem/0658.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/find-k-closest-elements) [🔗](https://leetcode.com/problems/find-k-closest-elements) |
4444
| 1099 | 小于 K 的两数之和 🔒 | | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`二分查找`](/tag/binary-search.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/two-sum-less-than-k) [🔗](https://leetcode.com/problems/two-sum-less-than-k) |
4545
| 75 | 颜色分类 | [[]](/problem/0075.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`排序`](/tag/sorting.md) | 🟠 | [🀄️](https://leetcode.cn/problems/sort-colors) [🔗](https://leetcode.com/problems/sort-colors) |
4646
| 360 | 有序转化数组 🔒 | | [`数组`](/tag/array.md) [`数学`](/tag/math.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/sort-transformed-array) [🔗](https://leetcode.com/problems/sort-transformed-array) |

src/plan/company_list.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ headerDepth: 0
2323
| 621 | 任务调度器 | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/task-scheduler) [🔗](https://leetcode.com/problems/task-scheduler) | 14 |
2424
| 375 | 猜数字大小 II | [[]](/problem/0375.md) | [`数学`](/tag/math.md) [`动态规划`](/tag/dynamic-programming.md) [`博弈`](/tag/game-theory.md) | 🟠 | [🀄️](https://leetcode.cn/problems/guess-number-higher-or-lower-ii) [🔗](https://leetcode.com/problems/guess-number-higher-or-lower-ii) | 14 |
2525
| 1056 | 易混淆数 🔒 | | [`数学`](/tag/math.md) | 🟢 | [🀄️](https://leetcode.cn/problems/confusing-number) [🔗](https://leetcode.com/problems/confusing-number) | 14 |
26-
| 1146 | 快照数组 | | [`设计`](/tag/design.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/snapshot-array) [🔗](https://leetcode.com/problems/snapshot-array) | 14 |
26+
| 1146 | 快照数组 | [[]](/problem/1146.md) | [`设计`](/tag/design.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/snapshot-array) [🔗](https://leetcode.com/problems/snapshot-array) | 14 |
2727
| 269 | 火星词典 🔒 | | [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) [``](/tag/graph.md) `3+` | 🔴 | [🀄️](https://leetcode.cn/problems/alien-dictionary) [🔗](https://leetcode.com/problems/alien-dictionary) | 14 |
2828
| 695 | 岛屿的最大面积 | [[]](/problem/0695.md) | [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) [`并查集`](/tag/union-find.md) `2+` | 🟠 | [🀄️](https://leetcode.cn/problems/max-area-of-island) [🔗](https://leetcode.com/problems/max-area-of-island) | 13 |
2929
| 57 | 插入区间 | [[]](/problem/0057.md) | [`数组`](/tag/array.md) | 🟠 | [🀄️](https://leetcode.cn/problems/insert-interval) [🔗](https://leetcode.com/problems/insert-interval) | 13 |
@@ -34,7 +34,7 @@ headerDepth: 0
3434
| 1377 | T 秒后青蛙的位置 | | [``](/tag/tree.md) [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/frog-position-after-t-seconds) [🔗](https://leetcode.com/problems/frog-position-after-t-seconds) | 12 |
3535
| 632 | 最小区间 | [[]](/problem/0632.md) | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `3+` | 🔴 | [🀄️](https://leetcode.cn/problems/smallest-range-covering-elements-from-k-lists) [🔗](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists) | 12 |
3636
| 127 | 单词接龙 | [[]](/problem/0127.md) | [`广度优先搜索`](/tag/breadth-first-search.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) | 🔴 | [🀄️](https://leetcode.cn/problems/word-ladder) [🔗](https://leetcode.com/problems/word-ladder) | 12 |
37-
| 528 | 按权重随机选择 | | [`数组`](/tag/array.md) [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) `2+` | 🟠 | [🀄️](https://leetcode.cn/problems/random-pick-with-weight) [🔗](https://leetcode.com/problems/random-pick-with-weight) | 12 |
37+
| 528 | 按权重随机选择 | [[]](/problem/0528.md) | [`数组`](/tag/array.md) [`数学`](/tag/math.md) [`二分查找`](/tag/binary-search.md) `2+` | 🟠 | [🀄️](https://leetcode.cn/problems/random-pick-with-weight) [🔗](https://leetcode.com/problems/random-pick-with-weight) | 12 |
3838
| 1825 | 求出 MK 平均值 | | [`设计`](/tag/design.md) [`队列`](/tag/queue.md) [`数据流`](/tag/data-stream.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/finding-mk-average) [🔗](https://leetcode.com/problems/finding-mk-average) | 12 |
3939
| 99 | 恢复二叉搜索树 | [[]](/problem/0099.md) | [``](/tag/tree.md) [`深度优先搜索`](/tag/depth-first-search.md) [`二叉搜索树`](/tag/binary-search-tree.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/recover-binary-search-tree) [🔗](https://leetcode.com/problems/recover-binary-search-tree) | 11 |
4040
| 302 | 包含全部黑色像素的最小矩形 🔒 | | [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) [`数组`](/tag/array.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/smallest-rectangle-enclosing-black-pixels) [🔗](https://leetcode.com/problems/smallest-rectangle-enclosing-black-pixels) | 11 |
@@ -92,7 +92,7 @@ headerDepth: 0
9292
| 560 | 和为 K 的子数组 | [[]](/problem/0560.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/subarray-sum-equals-k) [🔗](https://leetcode.com/problems/subarray-sum-equals-k) | 13 |
9393
| 71 | 简化路径 | [[]](/problem/0071.md) | [``](/tag/stack.md) [`字符串`](/tag/string.md) | 🟠 | [🀄️](https://leetcode.cn/problems/simplify-path) [🔗](https://leetcode.com/problems/simplify-path) | 13 |
9494
| 238 | 除自身以外数组的乘积 | [[]](/problem/0238.md) | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/product-of-array-except-self) [🔗](https://leetcode.com/problems/product-of-array-except-self) | 12 |
95-
| 1539 | 第 k 个缺失的正整数 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/kth-missing-positive-number) [🔗](https://leetcode.com/problems/kth-missing-positive-number) | 12 |
95+
| 1539 | 第 k 个缺失的正整数 | [[]](/problem/1539.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟢 | [🀄️](https://leetcode.cn/problems/kth-missing-positive-number) [🔗](https://leetcode.com/problems/kth-missing-positive-number) | 12 |
9696
| 125 | 验证回文串 | [[]](/problem/0125.md) | [`双指针`](/tag/two-pointers.md) [`字符串`](/tag/string.md) | 🟢 | [🀄️](https://leetcode.cn/problems/valid-palindrome) [🔗](https://leetcode.com/problems/valid-palindrome) | 12 |
9797
| 827 | 最大人工岛 | | [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) [`并查集`](/tag/union-find.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/making-a-large-island) [🔗](https://leetcode.com/problems/making-a-large-island) | 12 |
9898
| 199 | 二叉树的右视图 | [[]](/problem/0199.md) | [``](/tag/tree.md) [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/binary-tree-right-side-view) [🔗](https://leetcode.com/problems/binary-tree-right-side-view) | 12 |

0 commit comments

Comments
 (0)