Skip to content

Commit

Permalink
add 15 solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
2xiao committed Jan 7, 2025
1 parent cf716e2 commit 5d2a085
Show file tree
Hide file tree
Showing 44 changed files with 2,666 additions and 51 deletions.
15 changes: 15 additions & 0 deletions src/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ export default sidebar({
"0976",
"0977",
"0981",
"0983",
"0986",
"0989",
"0993",
Expand Down Expand Up @@ -769,6 +770,7 @@ export default sidebar({
"1760",
"1763",
"1768",
"1769",
"1773",
"1779",
"1784",
Expand Down Expand Up @@ -818,6 +820,7 @@ export default sidebar({
"1925",
"1926",
"1929",
"1930",
"1935",
"1941",
"1942",
Expand Down Expand Up @@ -921,6 +924,7 @@ export default sidebar({
"2262",
"2264",
"2269",
"2270",
"2273",
"2275",
"2278",
Expand All @@ -946,7 +950,16 @@ export default sidebar({
"2336",
"2337",
"2341",
"2347",
"2351",
"2352",
"2357",
"2363",
"2367",
"2373",
"2379",
"2381",
"2383",
"2390"
]
},
Expand All @@ -963,6 +976,7 @@ export default sidebar({
"2461",
"2462",
"2463",
"2466",
"2471",
"2490",
"2491"
Expand All @@ -978,6 +992,7 @@ export default sidebar({
"2542",
"2554",
"2558",
"2559",
"2563",
"2577",
"2583",
Expand Down
30 changes: 15 additions & 15 deletions src/plan/contest_list.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/problem/0001.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ var twoSum = function (nums, target) {
| 2006 | 差的绝对值为 K 的数对数目 | [[]](/problem/2006.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`计数`](/tag/counting.md) | 🟢 | [🀄️](https://leetcode.cn/problems/count-number-of-pairs-with-absolute-difference-k) [🔗](https://leetcode.com/problems/count-number-of-pairs-with-absolute-difference-k) |
| 2023 | 连接后等于目标字符串的字符串对 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target) [🔗](https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target) |
| 2200 | 找出数组中的所有 K 近邻下标 | [[]](/problem/2200.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) | 🟢 | [🀄️](https://leetcode.cn/problems/find-all-k-distant-indices-in-an-array) [🔗](https://leetcode.com/problems/find-all-k-distant-indices-in-an-array) |
| 2351 | 第一个出现两次的字母 | | [`位运算`](/tag/bit-manipulation.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/first-letter-to-appear-twice) [🔗](https://leetcode.com/problems/first-letter-to-appear-twice) |
| 2351 | 第一个出现两次的字母 | [[]](/problem/2351.md) | [`位运算`](/tag/bit-manipulation.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/first-letter-to-appear-twice) [🔗](https://leetcode.com/problems/first-letter-to-appear-twice) |
| 2354 | 优质数对的数目 | | [`位运算`](/tag/bit-manipulation.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/number-of-excellent-pairs) [🔗](https://leetcode.com/problems/number-of-excellent-pairs) |
| 2367 | 等差三元组的数目 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-arithmetic-triplets) [🔗](https://leetcode.com/problems/number-of-arithmetic-triplets) |
| 2367 | 等差三元组的数目 | [[]](/problem/2367.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-arithmetic-triplets) [🔗](https://leetcode.com/problems/number-of-arithmetic-triplets) |
| 2374 | 边积分最高的节点 | | [``](/tag/graph.md) [`哈希表`](/tag/hash-table.md) | 🟠 | [🀄️](https://leetcode.cn/problems/node-with-highest-edge-score) [🔗](https://leetcode.com/problems/node-with-highest-edge-score) |
| 2395 | 和相等的子数组 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) | 🟢 | [🀄️](https://leetcode.cn/problems/find-subarrays-with-equal-sum) [🔗](https://leetcode.com/problems/find-subarrays-with-equal-sum) |
| 2399 | 检查相同字母间的距离 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) | 🟢 | [🀄️](https://leetcode.cn/problems/check-distances-between-same-letters) [🔗](https://leetcode.com/problems/check-distances-between-same-letters) |
Expand Down
2 changes: 1 addition & 1 deletion src/problem/0015.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ var threeSum = function (nums) {
| 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) |
| 18 | 四数之和 | [[]](/problem/0018.md) | [`数组`](/tag/array.md) [`双指针`](/tag/two-pointers.md) [`排序`](/tag/sorting.md) | 🟠 | [🀄️](https://leetcode.cn/problems/4sum) [🔗](https://leetcode.com/problems/4sum) |
| 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) |
| 2367 | 等差三元组的数目 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-arithmetic-triplets) [🔗](https://leetcode.com/problems/number-of-arithmetic-triplets) |
| 2367 | 等差三元组的数目 | [[]](/problem/2367.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`双指针`](/tag/two-pointers.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/number-of-arithmetic-triplets) [🔗](https://leetcode.com/problems/number-of-arithmetic-triplets) |
| 2908 | 元素和最小的山形三元组 I | | [`数组`](/tag/array.md) | 🟢 | [🀄️](https://leetcode.cn/problems/minimum-sum-of-mountain-triplets-i) [🔗](https://leetcode.com/problems/minimum-sum-of-mountain-triplets-i) |
| 2909 | 元素和最小的山形三元组 II | | [`数组`](/tag/array.md) | 🟠 | [🀄️](https://leetcode.cn/problems/minimum-sum-of-mountain-triplets-ii) [🔗](https://leetcode.com/problems/minimum-sum-of-mountain-triplets-ii) |
2 changes: 1 addition & 1 deletion src/problem/0070.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var climbStairs = function (n) {
| 2244 | 完成所有任务需要的最少轮数 | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `1+` | 🟠 | [🀄️](https://leetcode.cn/problems/minimum-rounds-to-complete-all-tasks) [🔗](https://leetcode.com/problems/minimum-rounds-to-complete-all-tasks) |
| 2320 | 统计放置房子的方式数 | | [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/count-number-of-ways-to-place-houses) [🔗](https://leetcode.com/problems/count-number-of-ways-to-place-houses) |
| 2400 | 恰好移动 k 步到达某一位置的方法数目 | | [`数学`](/tag/math.md) [`动态规划`](/tag/dynamic-programming.md) [`组合数学`](/tag/combinatorics.md) | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-ways-to-reach-a-position-after-exactly-k-steps) [🔗](https://leetcode.com/problems/number-of-ways-to-reach-a-position-after-exactly-k-steps) |
| 2466 | 统计构造好字符串的方案数 | | [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/count-ways-to-build-good-strings) [🔗](https://leetcode.com/problems/count-ways-to-build-good-strings) |
| 2466 | 统计构造好字符串的方案数 | [[]](/problem/2466.md) | [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/count-ways-to-build-good-strings) [🔗](https://leetcode.com/problems/count-ways-to-build-good-strings) |
| 2498 | 青蛙过河 II | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`二分查找`](/tag/binary-search.md) | 🟠 | [🀄️](https://leetcode.cn/problems/frog-jump-ii) [🔗](https://leetcode.com/problems/frog-jump-ii) |
| 3154 | 到达第 K 级台阶的方案数 | | [`位运算`](/tag/bit-manipulation.md) [`记忆化搜索`](/tag/memoization.md) [`数学`](/tag/math.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/find-number-of-ways-to-reach-the-k-th-stair) [🔗](https://leetcode.com/problems/find-number-of-ways-to-reach-the-k-th-stair) |
| 3183 | 达到总和的方法数量 🔒 | | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/the-number-of-ways-to-make-the-sum) [🔗](https://leetcode.com/problems/the-number-of-ways-to-make-the-sum) |
2 changes: 1 addition & 1 deletion src/problem/0217.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ var containsDuplicate = function (nums) {
| :------: | :------ | :------: | :------ | :------: | :------: |
| 219 | 存在重复元素 II | [[]](/problem/0219.md) | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`滑动窗口`](/tag/sliding-window.md) | 🟢 | [🀄️](https://leetcode.cn/problems/contains-duplicate-ii) [🔗](https://leetcode.com/problems/contains-duplicate-ii) |
| 220 | 存在重复元素 III | | [`数组`](/tag/array.md) [`桶排序`](/tag/bucket-sort.md) [`有序集合`](/tag/ordered-set.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/contains-duplicate-iii) [🔗](https://leetcode.com/problems/contains-duplicate-iii) |
| 2357 | 使数组中所有元素都等于零 | | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `3+` | 🟢 | [🀄️](https://leetcode.cn/problems/make-array-zero-by-subtracting-equal-amounts) [🔗](https://leetcode.com/problems/make-array-zero-by-subtracting-equal-amounts) |
| 2357 | 使数组中所有元素都等于零 | [[]](/problem/2357.md) | [`贪心`](/tag/greedy.md) [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) `3+` | 🟢 | [🀄️](https://leetcode.cn/problems/make-array-zero-by-subtracting-equal-amounts) [🔗](https://leetcode.com/problems/make-array-zero-by-subtracting-equal-amounts) |
2 changes: 1 addition & 1 deletion src/problem/0307.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ class NumArray {
| :------: | :------ | :------: | :------ | :------: | :------: |
| 303 | 区域和检索 - 数组不可变 | [[]](/problem/0303.md) | [`设计`](/tag/design.md) [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟢 | [🀄️](https://leetcode.cn/problems/range-sum-query-immutable) [🔗](https://leetcode.com/problems/range-sum-query-immutable) |
| 308 | 二维区域和检索 - 矩阵可修改 🔒 | | [`设计`](/tag/design.md) [`树状数组`](/tag/binary-indexed-tree.md) [`线段树`](/tag/segment-tree.md) `2+` | 🔴 | [🀄️](https://leetcode.cn/problems/range-sum-query-2d-mutable) [🔗](https://leetcode.com/problems/range-sum-query-2d-mutable) |
| 2381 | 字母移位 II | | [`数组`](/tag/array.md) [`字符串`](/tag/string.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/shifting-letters-ii) [🔗](https://leetcode.com/problems/shifting-letters-ii) |
| 2381 | 字母移位 II | [[]](/problem/2381.md) | [`数组`](/tag/array.md) [`字符串`](/tag/string.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/shifting-letters-ii) [🔗](https://leetcode.com/problems/shifting-letters-ii) |
2 changes: 1 addition & 1 deletion src/problem/0322.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var coinChange = function (coins, amount) {
<!-- prettier-ignore -->
| 题号 | 标题 | 题解 | 标签 | 难度 | 力扣 |
| :------: | :------ | :------: | :------ | :------: | :------: |
| 983 | 最低票价 | | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/minimum-cost-for-tickets) [🔗](https://leetcode.com/problems/minimum-cost-for-tickets) |
| 983 | 最低票价 | [[]](/problem/0983.md) | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) | 🟠 | [🀄️](https://leetcode.cn/problems/minimum-cost-for-tickets) [🔗](https://leetcode.com/problems/minimum-cost-for-tickets) |
| 2218 | 从栈中取出 K 个硬币的最大面值和 | | [`数组`](/tag/array.md) [`动态规划`](/tag/dynamic-programming.md) [`前缀和`](/tag/prefix-sum.md) | 🔴 | [🀄️](https://leetcode.cn/problems/maximum-value-of-k-coins-from-piles) [🔗](https://leetcode.com/problems/maximum-value-of-k-coins-from-piles) |
| 2224 | 转化时间需要的最少操作数 | [[]](/problem/2224.md) | [`贪心`](/tag/greedy.md) [`字符串`](/tag/string.md) | 🟢 | [🀄️](https://leetcode.cn/problems/minimum-number-of-operations-to-convert-time) [🔗](https://leetcode.com/problems/minimum-number-of-operations-to-convert-time) |
| 2547 | 拆分数组的最小代价 | | [`数组`](/tag/array.md) [`哈希表`](/tag/hash-table.md) [`动态规划`](/tag/dynamic-programming.md) `1+` | 🔴 | [🀄️](https://leetcode.cn/problems/minimum-cost-to-split-an-array) [🔗](https://leetcode.com/problems/minimum-cost-to-split-an-array) |
Expand Down
2 changes: 1 addition & 1 deletion src/problem/0387.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ var firstUniqChar = function (s) {
| 题号 | 标题 | 题解 | 标签 | 难度 | 力扣 |
| :------: | :------ | :------: | :------ | :------: | :------: |
| 451 | 根据字符出现频率排序 | [[]](/problem/0451.md) | [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) [`桶排序`](/tag/bucket-sort.md) `3+` | 🟠 | [🀄️](https://leetcode.cn/problems/sort-characters-by-frequency) [🔗](https://leetcode.com/problems/sort-characters-by-frequency) |
| 2351 | 第一个出现两次的字母 | | [`位运算`](/tag/bit-manipulation.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/first-letter-to-appear-twice) [🔗](https://leetcode.com/problems/first-letter-to-appear-twice) |
| 2351 | 第一个出现两次的字母 | [[]](/problem/2351.md) | [`位运算`](/tag/bit-manipulation.md) [`哈希表`](/tag/hash-table.md) [`字符串`](/tag/string.md) `1+` | 🟢 | [🀄️](https://leetcode.cn/problems/first-letter-to-appear-twice) [🔗](https://leetcode.com/problems/first-letter-to-appear-twice) |
2 changes: 1 addition & 1 deletion src/problem/0724.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ var pivotIndex = function (nums) {
| 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) |
| 1991 | 找到数组的中间位置 | [[]](/problem/1991.md) | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟢 | [🀄️](https://leetcode.cn/problems/find-the-middle-index-in-array) [🔗](https://leetcode.com/problems/find-the-middle-index-in-array) |
| 2219 | 数组的最大总分 🔒 | | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/maximum-sum-score-of-array) [🔗](https://leetcode.com/problems/maximum-sum-score-of-array) |
| 2270 | 分割数组的方案数 | | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-ways-to-split-array) [🔗](https://leetcode.com/problems/number-of-ways-to-split-array) |
| 2270 | 分割数组的方案数 | [[]](/problem/2270.md) | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟠 | [🀄️](https://leetcode.cn/problems/number-of-ways-to-split-array) [🔗](https://leetcode.com/problems/number-of-ways-to-split-array) |
| 2574 | 左右元素和的差值 | | [`数组`](/tag/array.md) [`前缀和`](/tag/prefix-sum.md) | 🟢 | [🀄️](https://leetcode.cn/problems/left-and-right-sum-differences) [🔗](https://leetcode.com/problems/left-and-right-sum-differences) |
Loading

0 comments on commit 5d2a085

Please sign in to comment.