Skip to content

Commit b7d3ab2

Browse files
committed
add 13 solutions
1 parent 7ab0a22 commit b7d3ab2

Some content is hidden

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

48 files changed

+2612
-208
lines changed

src/.vuepress/sidebar.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default sidebar({
136136
"0112",
137137
"0113",
138138
"0114",
139+
"0115",
139140
"0116",
140141
"0117",
141142
"0118",
@@ -462,6 +463,7 @@ export default sidebar({
462463
"0641",
463464
"0643",
464465
"0645",
466+
"0646",
465467
"0649",
466468
"0653",
467469
"0654",
@@ -471,6 +473,7 @@ export default sidebar({
471473
"0662",
472474
"0670",
473475
"0671",
476+
"0673",
474477
"0674",
475478
"0678",
476479
"0680",
@@ -505,6 +508,7 @@ export default sidebar({
505508
"0733",
506509
"0735",
507510
"0739",
511+
"0740",
508512
"0744",
509513
"0746",
510514
"0747",
@@ -618,7 +622,10 @@ export default sidebar({
618622
"1021",
619623
"1022",
620624
"1025",
625+
"1027",
626+
"1028",
621627
"1030",
628+
"1035",
622629
"1037",
623630
"1046",
624631
"1047",
@@ -663,6 +670,7 @@ export default sidebar({
663670
"1200",
664671
"1207",
665672
"1217",
673+
"1218",
666674
"1221",
667675
"1232",
668676
"1233",
@@ -766,6 +774,7 @@ export default sidebar({
766774
"1518",
767775
"1522",
768776
"1523",
777+
"1524",
769778
"1527",
770779
"1528",
771780
"1534",
@@ -834,6 +843,7 @@ export default sidebar({
834843
"1736",
835844
"1742",
836845
"1748",
846+
"1749",
837847
"1752",
838848
"1757",
839849
"1758",
@@ -901,6 +911,7 @@ export default sidebar({
901911
"1957",
902912
"1961",
903913
"1963",
914+
"1964",
904915
"1967",
905916
"1971",
906917
"1974",
@@ -960,6 +971,7 @@ export default sidebar({
960971
"2130",
961972
"2133",
962973
"2138",
974+
"2140",
963975
"2144",
964976
"2148",
965977
"2154",
@@ -1058,6 +1070,7 @@ export default sidebar({
10581070
"2462",
10591071
"2463",
10601072
"2466",
1073+
"2467",
10611074
"2471",
10621075
"2490",
10631076
"2491",

src/book/dynamic_programming.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@
6969
| 题号 | 标题 | 题解 | 标签 | 难度 | 力扣 |
7070
| :------: | :------ | :------: | :------ | :------: | :------: |
7171
| 300 | 最长递增子序列 | [[]](/problem/0300.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/longest-increasing-subsequence) [🔗](https://leetcode.com/problems/longest-increasing-subsequence) |
72-
| 673 | 最长递增子序列的个数 | | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
72+
| 673 | 最长递增子序列的个数 | [[]](/problem/0673.md) | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
7373
| 354 | 俄罗斯套娃信封问题 | [[]](/problem/0354.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/russian-doll-envelopes) [🔗](https://leetcode.com/problems/russian-doll-envelopes) |
7474
| 53 | 最大子数组和 | [[]](/problem/0053.md) | [`数组`](/tag/array.md) [`分治`](/tag/divide-and-conquer.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/maximum-subarray) [🔗](https://leetcode.com/problems/maximum-subarray) |
7575
| 152 | 乘积最大子数组 | [[]](/problem/0152.md) | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/maximum-product-subarray) [🔗](https://leetcode.com/problems/maximum-product-subarray) |
7676
| 918 | 环形子数组的最大和 | [[]](/problem/0918.md) | [`队列`](/tag/queue.md) [`数组`](/tag/array.md) [`分治`](/tag/divide-and-conquer.md) `2+` | 🟠 | [🀄️](https://leetcode.cn/problems/maximum-sum-circular-subarray) [🔗](https://leetcode.com/problems/maximum-sum-circular-subarray) |
7777
| 198 | 打家劫舍 | [[]](/problem/0198.md) | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/house-robber) [🔗](https://leetcode.com/problems/house-robber) |
7878
| 213 | 打家劫舍 II | [[]](/problem/0213.md) | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/house-robber-ii) [🔗](https://leetcode.com/problems/house-robber-ii) |
79-
| 740 | 删除并获得点数 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/delete-and-earn) [🔗](https://leetcode.com/problems/delete-and-earn) |
79+
| 740 | 删除并获得点数 | [[]](/problem/0740.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/delete-and-earn) [🔗](https://leetcode.com/problems/delete-and-earn) |
8080
| 1388 | 3n 块披萨 | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/pizza-with-3n-slices) [🔗](https://leetcode.com/problems/pizza-with-3n-slices) |
8181
| 873 | 最长的斐波那契子序列的长度 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/length-of-longest-fibonacci-subsequence) [🔗](https://leetcode.com/problems/length-of-longest-fibonacci-subsequence) |
82-
| 1027 | 最长等差数列 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`二分查找`](/tag/binary-search.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/longest-arithmetic-subsequence) [🔗](https://leetcode.com/problems/longest-arithmetic-subsequence) |
82+
| 1027 | 最长等差数列 | [[]](/problem/1027.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`二分查找`](/tag/binary-search.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/longest-arithmetic-subsequence) [🔗](https://leetcode.com/problems/longest-arithmetic-subsequence) |
8383
| 1055 | 形成字符串的最短路径 🔒 | | [`贪心`](/tag/greedy.md) [`双指针`](/tag/two-pointers.md) [`字符串`](/tag/string.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/shortest-way-to-form-string) [🔗](https://leetcode.com/problems/shortest-way-to-form-string) |
8484
| 368 | 最大整除子集 | [[]](/problem/0368.md) | [`数组`](/tag/array.md) [`数学`](/tag/math.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/largest-divisible-subset) [🔗](https://leetcode.com/problems/largest-divisible-subset) |
8585
| 32 | 最长有效括号 | [[]](/problem/0032.md) | [``](/tag/stack.md) [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/longest-valid-parentheses) [🔗](https://leetcode.com/problems/longest-valid-parentheses) |
@@ -124,7 +124,7 @@
124124
| 44 | 通配符匹配 | [[]](/problem/0044.md) | [`贪心`](/tag/greedy.md) [`递归`](/tag/recursion.md) [`字符串`](/tag/string.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/wildcard-matching) [🔗](https://leetcode.com/problems/wildcard-matching) |
125125
| 10 | 正则表达式匹配 | [[]](/problem/0010.md) | [`递归`](/tag/recursion.md) [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/regular-expression-matching) [🔗](https://leetcode.com/problems/regular-expression-matching) |
126126
| 97 | 交错字符串 | [[]](/problem/0097.md) | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/interleaving-string) [🔗](https://leetcode.com/problems/interleaving-string) |
127-
| 115 | 不同的子序列 | | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/distinct-subsequences) [🔗](https://leetcode.com/problems/distinct-subsequences) |
127+
| 115 | 不同的子序列 | [[]](/problem/0115.md) | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/distinct-subsequences) [🔗](https://leetcode.com/problems/distinct-subsequences) |
128128
| 87 | 扰乱字符串 | | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/scramble-string) [🔗](https://leetcode.com/problems/scramble-string) |
129129

130130
* 矩阵线性 DP 问题

src/book/tree.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ class NumArray {
11241124
| 370 | 区间加法 🔒 | | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/range-addition) [🔗](https://leetcode.com/problems/range-addition) |
11251125
| 1109 | 航班预订统计 | | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/corporate-flight-bookings) [🔗](https://leetcode.com/problems/corporate-flight-bookings) |
11261126
| 1450 | 在既定时间做作业的学生人数 | [[]](/problem/1450.md) | [`数组`](/tag/array.md) | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-students-doing-homework-at-a-given-time) [🔗](https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time) |
1127-
| 673 | 最长递增子序列的个数 | | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
1127+
| 673 | 最长递增子序列的个数 | [[]](/problem/0673.md) | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
11281128
| 1310 | 子数组异或查询 | | [`位运算`](/tag/bit-manipulation.md) [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/xor-queries-of-a-subarray) [🔗](https://leetcode.com/problems/xor-queries-of-a-subarray) |
11291129
| 1851 | 包含每个查询的最小区间 | | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`排序`](/tag/sorting.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/minimum-interval-to-include-each-query) [🔗](https://leetcode.com/problems/minimum-interval-to-include-each-query) |
11301130

@@ -1156,7 +1156,7 @@ class NumArray {
11561156
| 315 | 计算右侧小于当前元素的个数 | | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `4+` | 🔴 | [🀄️](https://leetcode.cn/problems/count-of-smaller-numbers-after-self) [🔗](https://leetcode.com/problems/count-of-smaller-numbers-after-self) |
11571157
| 1450 | 在既定时间做作业的学生人数 | [[]](/problem/1450.md) | [`数组`](/tag/array.md) | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-students-doing-homework-at-a-given-time) [🔗](https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time) |
11581158
| 354 | 俄罗斯套娃信封问题 | [[]](/problem/0354.md) | [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/russian-doll-envelopes) [🔗](https://leetcode.com/problems/russian-doll-envelopes) |
1159-
| 673 | 最长递增子序列的个数 | | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
1159+
| 673 | 最长递增子序列的个数 | [[]](/problem/0673.md) | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) |
11601160
| 1310 | 子数组异或查询 | | [`位运算`](/tag/bit-manipulation.md) [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/xor-queries-of-a-subarray) [🔗](https://leetcode.com/problems/xor-queries-of-a-subarray) |
11611161
| 1893 | 检查是否区域内所有整数都被覆盖 | [[]](/problem/1893.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`前缀和`](/tag/prefix-sum.md) | 🟢 | [🀄️](https://leetcode.cn/problems/check-if-all-the-integers-in-a-range-are-covered) [🔗](https://leetcode.com/problems/check-if-all-the-integers-in-a-range-are-covered) |
11621162

src/plan/codetop_list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ headerDepth: 0
193193
| 44 | 通配符匹配 | [[]](/problem/0044.md) | [`贪心`](/tag/greedy.md) [`递归`](/tag/recursion.md) [`字符串`](/tag/string.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/wildcard-matching) [🔗](https://leetcode.com/problems/wildcard-matching) | 19 |
194194
| 556 | 下一个更大元素 III | | [`数学`](/tag/math.md) [`双指针`](/tag/two-pointers.md) [`字符串`](/tag/string.md) | 🟠 | [🀄️](https://leetcode.cn/problems/next-greater-element-iii) [🔗](https://leetcode.com/problems/next-greater-element-iii) | 19 |
195195
| 210 | 课程表 II | [[]](/problem/0210.md) | [`深度优先搜索`](/tag/depth-first-search.md) [`广度优先搜索`](/tag/breadth-first-search.md) [``](/tag/graph.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/course-schedule-ii) [🔗](https://leetcode.com/problems/course-schedule-ii) | 19 |
196-
| 673 | 最长递增子序列的个数 | | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) | 19 |
196+
| 673 | 最长递增子序列的个数 | [[]](/problem/0673.md) | [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) [`数组`](/tag/array.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-longest-increasing-subsequence) [🔗](https://leetcode.com/problems/number-of-longest-increasing-subsequence) | 19 |
197197
| 442 | 数组中重复的数据 | [[]](/problem/0442.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) | 🟠 | [🀄️](https://leetcode.cn/problems/find-all-duplicates-in-an-array) [🔗](https://leetcode.com/problems/find-all-duplicates-in-an-array) | 19 |
198198
| 509 | 斐波那契数 | [[]](/problem/0509.md) | [`递归`](/tag/recursion.md) [`记忆化搜索`](/tag/memoization.md) [`数学`](/tag/math.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/fibonacci-number) [🔗](https://leetcode.com/problems/fibonacci-number) | 19 |
199199
| 395 | 至少有 K 个重复字符的最长子串 | [[]](/problem/0395.md) | [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) [`分治`](/tag/divide-and-conquer.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/longest-substring-with-at-least-k-repeating-characters) [🔗](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters) | 18 |
@@ -208,7 +208,7 @@ headerDepth: 0
208208
| 86 | 分隔链表 | [[]](/problem/0086.md) | [`链表`](/tag/linked-list.md) [`双指针`](/tag/two-pointers.md) | 🟠 | [🀄️](https://leetcode.cn/problems/partition-list) [🔗](https://leetcode.com/problems/partition-list) | 18 |
209209
| 494 | 目标和 | [[]](/problem/0494.md) | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) [`回溯`](/tag/backtracking.md) | 🟠 | [🀄️](https://leetcode.cn/problems/target-sum) [🔗](https://leetcode.com/problems/target-sum) | 17 |
210210
| 516 | 最长回文子序列 | [[]](/problem/0516.md) | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/longest-palindromic-subsequence) [🔗](https://leetcode.com/problems/longest-palindromic-subsequence) | 17 |
211-
| 115 | 不同的子序列 | | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/distinct-subsequences) [🔗](https://leetcode.com/problems/distinct-subsequences) | 17 |
211+
| 115 | 不同的子序列 | [[]](/problem/0115.md) | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🔴 | [🀄️](https://leetcode.cn/problems/distinct-subsequences) [🔗](https://leetcode.com/problems/distinct-subsequences) | 17 |
212212
| 84 | 柱状图中最大的矩形 | [[]](/problem/0084.md) | [``](/tag/stack.md) [`数组`](/tag/array.md) [`单调栈`](/tag/monotonic-stack.md) | 🔴 | [🀄️](https://leetcode.cn/problems/largest-rectangle-in-histogram) [🔗](https://leetcode.com/problems/largest-rectangle-in-histogram) | 17 |
213213
| 97 | 交错字符串 | [[]](/problem/0097.md) | [`字符串`](/tag/string.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/interleaving-string) [🔗](https://leetcode.com/problems/interleaving-string) | 17 |
214214
| 264 | 丑数 II | [[]](/problem/0264.md) | [`哈希表`](/tag/hash-table.md) [`数学`](/tag/math.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/ugly-number-ii) [🔗](https://leetcode.com/problems/ugly-number-ii) | 17 |

0 commit comments

Comments
 (0)