Skip to content

Commit cf59818

Browse files
authored
feat: update lc problems (#3321)
1 parent aec8527 commit cf59818

File tree

10 files changed

+53
-56
lines changed

10 files changed

+53
-56
lines changed

solution/0000-0099/0015.3Sum/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ tags:
1818

1919
<!-- description:start -->
2020

21-
<p>给你一个整数数组 <code>nums</code> ,判断是否存在三元组 <code>[nums[i], nums[j], nums[k]]</code> 满足 <code>i != j</code>、<code>i != k</code> 且 <code>j != k</code> ,同时还满足 <code>nums[i] + nums[j] + nums[k] == 0</code> 。请</p>
22-
23-
<p>你返回所有和为 <code>0</code> 且不重复的三元组。</p>
21+
<p>给你一个整数数组 <code>nums</code> ,判断是否存在三元组 <code>[nums[i], nums[j], nums[k]]</code> 满足 <code>i != j</code>、<code>i != k</code> 且 <code>j != k</code> ,同时还满足 <code>nums[i] + nums[j] + nums[k] == 0</code> 。请你返回所有和为 <code>0</code> 且不重复的三元组。</p>
2422

2523
<p><strong>注意:</strong>答案中不可以包含重复的三元组。</p>
2624

solution/2100-2199/2191.Sort the Jumbled Numbers/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tags:
3838
<pre>
3939
<strong>Input:</strong> mapping = [8,9,4,0,2,1,3,5,7,6], nums = [991,338,38]
4040
<strong>Output:</strong> [338,38,991]
41-
<strong>Explanation:</strong>
41+
<strong>Explanation:</strong>
4242
Map the number 991 as follows:
4343
1. mapping[9] = 6, so all occurrences of the digit 9 will become 6.
4444
2. mapping[1] = 9, so all occurrences of the digit 1 will become 9.

solution/3000-3099/3096.Minimum Levels to Gain More Points/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>给你一个长度为 <code>n</code>&nbsp;的二进制数组&nbsp;<code>possible</code>&nbsp;。</p>
2323

24-
<p>Alice 和 Bob 正在玩一个有 <code>n</code> 个关卡的游戏,游戏中有一些关卡是 <strong>困难</strong>&nbsp;模式,其他的关卡是 <strong>简单</strong>&nbsp;模式。如果&nbsp;<code>possible[i] == 0</code>&nbsp;,那么第&nbsp;<code>i</code> 个关卡是 <strong>困难</strong>&nbsp;模式。一个玩家通过一个简单模式的关卡可以获得 <code>1</code>&nbsp;分,通过困难模式的关卡将失去 <code>1</code>&nbsp;分。</p>
24+
<p>Alice 和 Bob 正在玩一个有 <code>n</code> 个关卡的游戏,游戏中有一些关卡是 <strong>困难</strong>&nbsp;模式,其他的关卡是 <strong>简单</strong>&nbsp;模式。如果&nbsp;<code>possible[i] == 0</code>&nbsp;,那么第&nbsp;<code>i</code> 个关卡是 <strong>困难</strong>&nbsp;模式,两个玩家&nbsp;<strong>都不可能</strong> 通过。一个玩家通过一个简单模式的关卡可以获得 <code>1</code>&nbsp;分,遇到困难模式的关卡将失去 <code>1</code>&nbsp;分。</p>
2525

2626
<p>游戏的一开始,Alice 将从第 <code>0</code>&nbsp;级开始 <strong>按顺序</strong> 完成一些关卡,然后 Bob 会完成剩下的所有关卡。</p>
2727

solution/3100-3199/3112.Minimum Time to Visit Disappearing Nodes/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ tags:
3636
<p><img 10px="" alt="" padding:="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/3100-3199/3112.Minimum%20Time%20to%20Visit%20Disappearing%20Nodes/images/example1.png" style="width: 350px; height: 210px;" /></p>
3737

3838
<div class="example-block" style="border-color: var(--border-tertiary); border-left-width: 2px; color: var(--text-secondary); margin-bottom: 1rem; margin-top: 1rem; overflow: visible; padding-left: 1rem;">
39-
<p style=""><span class="example-io" style="font-size: 8.75px;"><b>输入:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">n = 3, edges = [[0,1,2],[1,2,1],[0,2,4]], disappear = [1,1,5]</span></p>
39+
<p style=""><span class="example-io"><b>输入:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">n = 3, edges = [[0,1,2],[1,2,1],[0,2,4]], disappear = [1,1,5]</span></p>
4040

41-
<p style=""><span class="example-io" style="font-size: 8.75px;"><b>输出:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">[0,-1,4]</span></p>
41+
<p style=""><span class="example-io"><b>输出:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">[0,-1,4]</span></p>
4242

4343
<p style="font-size: 0.875rem;"><strong>解释:</strong></p>
4444

@@ -56,9 +56,9 @@ tags:
5656
<p><img 10px="" alt="" padding:="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/3100-3199/3112.Minimum%20Time%20to%20Visit%20Disappearing%20Nodes/images/example2.png" style="width: 350px; height: 210px;" /></p>
5757

5858
<div class="example-block" style="border-color: var(--border-tertiary); border-left-width: 2px; color: var(--text-secondary); margin-bottom: 1rem; margin-top: 1rem; overflow: visible; padding-left: 1rem;">
59-
<p style=""><span class="example-io" style="font-size: 8.75px;"><b>输入:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">n = 3, edges = [[0,1,2],[1,2,1],[0,2,4]], disappear = [1,3,5]</span></p>
59+
<p style=""><span class="example-io"><b>输入:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">n = 3, edges = [[0,1,2],[1,2,1],[0,2,4]], disappear = [1,3,5]</span></p>
6060

61-
<p style=""><span class="example-io" style="font-size: 8.75px;"><b>输出:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">[0,2,3]</span></p>
61+
<p style=""><span class="example-io"><b>输出:</b></span><span class="example-io" style="font-size: 0.85rem; font-family: Menlo, sans-serif;">[0,2,3]</span></p>
6262

6363
<p style="font-size: 0.875rem;"><strong>解释:</strong></p>
6464

solution/3200-3299/3220.Odd and Even Transactions/README.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ tags:
88

99
<!-- problem:start -->
1010

11-
# [3220. Odd and Even Transactions](https://leetcode.cn/problems/odd-and-even-transactions)
11+
# [3220. 奇数和偶数交易](https://leetcode.cn/problems/odd-and-even-transactions)
1212

1313
[English Version](/solution/3200-3299/3220.Odd%20and%20Even%20Transactions/README_EN.md)
1414

1515
## 题目描述
1616

1717
<!-- description:start -->
1818

19-
<p>Table: <code>transactions</code></p>
19+
<p>表:<code>transactions</code></p>
2020

2121
<pre>
2222
+------------------+------+
@@ -26,23 +26,24 @@ tags:
2626
| amount | int |
2727
| transaction_date | date |
2828
+------------------+------+
29-
The transactions_id column uniquely identifies each row in this table.
30-
Each row of this table contains the transaction id, amount and transaction date.
29+
transactions_id 列唯一标识了表中的每一行。
30+
这张表的每一行包含交易 id,金额总和和交易日期。
3131
</pre>
3232

33-
<p>Write a solution to find the <strong>sum of amounts</strong> for <strong>odd</strong> and <strong>even</strong> transactions for each day. If there are no odd or even transactions for a specific date, display as <code>0</code>.</p>
33+
<p>编写一个解决方案来查找每天 <strong>奇数</strong> 交易金额和 <strong>偶数</strong> 交易金额的 <strong>总和</strong>。如果某天没有奇数或偶数交易,显示为&nbsp;<code>0</code></p>
3434

35-
<p>Return <em>the result table ordered by</em> <code>transaction_date</code> <em>in <strong>ascending</strong> order</em>.</p>
35+
<p>返回结果表以&nbsp;<code>transaction_date</code> <strong>升序</strong>&nbsp;排序。</p>
3636

37-
<p>The result format is in the following example.</p>
37+
<p>结果格式如下所示。</p>
3838

3939
<p>&nbsp;</p>
40-
<p><strong class="example">Example:</strong></p>
40+
41+
<p><strong class="example">示例:</strong></p>
4142

4243
<div class="example-block">
43-
<p><strong>Input:</strong></p>
44+
<p><b>输入:</b></p>
4445

45-
<p><code>transactions</code> table:</p>
46+
<p><code>transactions</code> 表:</p>
4647

4748
<pre class="example-io">
4849
+----------------+--------+------------------+
@@ -57,7 +58,7 @@ Each row of this table contains the transaction id, amount and transaction date.
5758
+----------------+--------+------------------+
5859
</pre>
5960

60-
<p><strong>Output:</strong></p>
61+
<p><strong>输出:</strong></p>
6162

6263
<pre class="example-io">
6364
+------------------+---------+----------+
@@ -69,34 +70,34 @@ Each row of this table contains the transaction id, amount and transaction date.
6970
+------------------+---------+----------+
7071
</pre>
7172

72-
<p><strong>Explanation:</strong></p>
73+
<p><strong>解释:</strong></p>
7374

7475
<ul>
75-
<li>For transaction dates:
76+
<li>对于交易日期:
7677
<ul>
7778
<li>2024-07-01:
7879
<ul>
79-
<li>Sum of amounts for odd transactions: 75</li>
80-
<li>Sum of amounts for even transactions: 150 + 200 = 350</li>
80+
<li>奇数交易金额总和:75</li>
81+
<li>偶数交易金额总和:150 + 200 = 350</li>
8182
</ul>
8283
</li>
8384
<li>2024-07-02:
8485
<ul>
85-
<li>Sum of amounts for odd transactions: 0</li>
86-
<li>Sum of amounts for even transactions: 300 + 50 = 350</li>
86+
<li>奇数交易金额总和:0</li>
87+
<li>偶数交易金额总和:300 + 50 = 350</li>
8788
</ul>
8889
</li>
8990
<li>2024-07-03:
9091
<ul>
91-
<li>Sum of amounts for odd transactions: 0</li>
92-
<li>Sum of amounts for even transactions: 120</li>
92+
<li>奇数交易金额总和:0</li>
93+
<li>偶数交易金额总和:120</li>
9394
</ul>
9495
</li>
9596
</ul>
9697
</li>
9798
</ul>
9899

99-
<p><strong>Note:</strong> The output table is ordered by <code>transaction_date</code> in ascending order.</p>
100+
<p><b>注意:</b>输出表以&nbsp;<code>transaction_date</code>&nbsp;升序排序。</p>
100101
</div>
101102

102103
<!-- description:end -->

solution/3200-3299/3221.Maximum Array Hopping Score II/README.md

+19-21
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,50 @@ tags:
1111

1212
<!-- problem:start -->
1313

14-
# [3221. Maximum Array Hopping Score II 🔒](https://leetcode.cn/problems/maximum-array-hopping-score-ii)
14+
# [3221. 最大数组跳跃得分 II 🔒](https://leetcode.cn/problems/maximum-array-hopping-score-ii)
1515

1616
[English Version](/solution/3200-3299/3221.Maximum%20Array%20Hopping%20Score%20II/README_EN.md)
1717

1818
## 题目描述
1919

2020
<!-- description:start -->
2121

22-
<p>Given an array <code>nums</code>, you have to get the <strong>maximum</strong> score starting from index 0 and <strong>hopping</strong> until you reach the last element of the array.</p>
22+
<p>给定一个数组&nbsp;<code>nums</code>,你必须从索引 0 开始跳跃,直到到达数组的最后一个元素,使得获取 <strong>最大</strong> 分数。</p>
2323

24-
<p>In each <strong>hop</strong>, you can jump from index <code>i</code> to an index <code>j &gt; i</code>, and you get a <strong>score</strong> of <code>(j - i) * nums[j]</code>.</p>
24+
<p>每一次 <strong>跳跃</strong> 中,你可以从下标&nbsp;<code>i</code>&nbsp;跳到一个&nbsp;<code>j &gt; i</code>&nbsp;的下标,并且可以得到&nbsp;<code>(j - i) * nums[j]</code>&nbsp;的分数。</p>
2525

26-
<p>Return the <em>maximum score</em> you can get.</p>
26+
<p>返回你能够取得的最大分数。</p>
2727

2828
<p>&nbsp;</p>
29-
<p><strong class="example">Example 1:</strong></p>
3029

31-
<div class="example-block">
32-
<p><strong>Input:</strong> <span class="example-io">nums = [1,5,8]</span></p>
30+
<p><strong>示例 1:</strong></p>
3331

34-
<p><strong>Output:</strong> <span class="example-io">16</span></p>
32+
<p><b>输入:</b>nums = [1,5,8]</p>
3533

36-
<p><strong>Explanation:</strong></p>
34+
<p><b>输出:</b>16</p>
3735

38-
<p>There are two possible ways to reach the last element:</p>
36+
<p><strong>解释:</strong></p>
37+
38+
<p>有两种可能的方法可以到达最后一个元素:</p>
3939

4040
<ul>
41-
<li><code>0 -&gt; 1 -&gt; 2</code> with a score of <code>(1 - 0) * 5 + (2 - 1) * 8 = 13</code>.</li>
42-
<li><code>0 -&gt; 2</code> with a score of <code>(2 - 0) * 8 = 16</code>.</li>
41+
<li><code>0 -&gt; 1 -&gt; 2</code> 得分为&nbsp;<code>(1 - 0) * 5 + (2 - 1) * 8 = 13</code></li>
42+
<li><code>0 -&gt; 2</code> 得分为&nbsp;<code>(2 - 0) * 8 =&nbsp;16</code></li>
4343
</ul>
44-
</div>
4544

46-
<p><strong class="example">Example 2:</strong></p>
45+
<p><strong>示例 2:</strong></p>
4746

48-
<div class="example-block">
49-
<p><strong>Input:</strong> <span class="example-io">nums = [4,5,2,8,9,1,3]</span></p>
47+
<p><b>输入:</b>nums = [4,5,2,8,9,1,3]</p>
5048

51-
<p><strong>Output:</strong> <span class="example-io">42</span></p>
49+
<p><b>输出:</b>42</p>
5250

53-
<p><strong>Explanation:</strong></p>
51+
<p><strong>解释:</strong></p>
5452

55-
<p>We can do the hopping <code>0 -&gt; 4 -&gt; 6</code> with a score of&nbsp;<code>(4 - 0) * 9 + (6 - 4) * 3 = 42</code>.</p>
56-
</div>
53+
<p>我们可以按&nbsp;<code>0 -&gt; 4 -&gt; 6</code>&nbsp;进行跳跃,得分为&nbsp;<code>(4 - 0) * 9 + (6 - 4) * 3 = 42</code>。</p>
5754

5855
<p>&nbsp;</p>
59-
<p><strong>Constraints:</strong></p>
56+
57+
<p><b>提示:</b></p>
6058

6159
<ul>
6260
<li><code>2 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>

solution/CONTEST_README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ comments: true
2626

2727
## 往期竞赛
2828

29-
#### 第 407 场周赛(2024-07-21 10:30, 90 分钟) 参赛人数 3169
29+
#### 第 407 场周赛(2024-07-21 10:30, 90 分钟) 参赛人数 3268
3030

3131
- [3226. 使两个整数相等的位更改次数](/solution/3200-3299/3226.Number%20of%20Bit%20Changes%20to%20Make%20Two%20Integers%20Equal/README.md)
3232
- [3227. 字符串元音游戏](/solution/3200-3299/3227.Vowels%20Game%20in%20a%20String/README.md)
3333
- [3228. 将 1 移动到末尾的最大操作次数](/solution/3200-3299/3228.Maximum%20Number%20of%20Operations%20to%20Move%20Ones%20to%20the%20End/README.md)
3434
- [3229. 使数组等于目标数组所需的最少操作次数](/solution/3200-3299/3229.Minimum%20Operations%20to%20Make%20Array%20Equal%20to%20Target/README.md)
3535

36-
#### 第 135 场双周赛(2024-07-20 22:30, 90 分钟) 参赛人数 2259
36+
#### 第 135 场双周赛(2024-07-20 22:30, 90 分钟) 参赛人数 2260
3737

3838
- [3222. 求出硬币游戏的赢家](/solution/3200-3299/3222.Find%20the%20Winning%20Player%20in%20Coin%20Game/README.md)
3939
- [3223. 操作后字符串的最短长度](/solution/3200-3299/3223.Minimum%20Length%20of%20String%20After%20Operations/README.md)

solution/DATABASE_README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
| 3198 | [查找每个州的城市](/solution/3100-3199/3198.Find%20Cities%20in%20Each%20State/README.md) | `数据库` | 简单 | 🔒 |
288288
| 3204 | [按位用户权限分析](/solution/3200-3299/3204.Bitwise%20User%20Permissions%20Analysis/README.md) | `数据库` | 中等 | 🔒 |
289289
| 3214 | [同比增长率](/solution/3200-3299/3214.Year%20on%20Year%20Growth%20Rate/README.md) | `数据库` | 困难 | 🔒 |
290-
| 3220 | [Odd and Even Transactions](/solution/3200-3299/3220.Odd%20and%20Even%20Transactions/README.md) | `数据库` | 中等 | |
290+
| 3220 | [奇数和偶数交易](/solution/3200-3299/3220.Odd%20and%20Even%20Transactions/README.md) | `数据库` | 中等 | |
291291
| 3230 | [客户购买行为分析](/solution/3200-3299/3230.Customer%20Purchasing%20Behavior%20Analysis/README.md) | `数据库` | 中等 | 🔒 |
292292

293293
## 版权

solution/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3230,8 +3230,8 @@
32303230
| 3217 | [从链表中移除在数组中存在的节点](/solution/3200-3299/3217.Delete%20Nodes%20From%20Linked%20List%20Present%20in%20Array/README.md) | `数组`,`哈希表`,`链表` | 中等 | 第 406 场周赛 |
32313231
| 3218 | [切蛋糕的最小总开销 I](/solution/3200-3299/3218.Minimum%20Cost%20for%20Cutting%20Cake%20I/README.md) | `贪心`,`数组`,`动态规划`,`排序` | 中等 | 第 406 场周赛 |
32323232
| 3219 | [切蛋糕的最小总开销 II](/solution/3200-3299/3219.Minimum%20Cost%20for%20Cutting%20Cake%20II/README.md) | `贪心`,`数组`,`排序` | 困难 | 第 406 场周赛 |
3233-
| 3220 | [Odd and Even Transactions](/solution/3200-3299/3220.Odd%20and%20Even%20Transactions/README.md) | `数据库` | 中等 | |
3234-
| 3221 | [Maximum Array Hopping Score II](/solution/3200-3299/3221.Maximum%20Array%20Hopping%20Score%20II/README.md) | `栈`,`贪心`,`数组`,`单调栈` | 中等 | 🔒 |
3233+
| 3220 | [奇数和偶数交易](/solution/3200-3299/3220.Odd%20and%20Even%20Transactions/README.md) | `数据库` | 中等 | |
3234+
| 3221 | [最大数组跳跃得分 II](/solution/3200-3299/3221.Maximum%20Array%20Hopping%20Score%20II/README.md) | `栈`,`贪心`,`数组`,`单调栈` | 中等 | 🔒 |
32353235
| 3222 | [求出硬币游戏的赢家](/solution/3200-3299/3222.Find%20the%20Winning%20Player%20in%20Coin%20Game/README.md) | `数学`,`博弈`,`模拟` | 简单 | 第 135 场双周赛 |
32363236
| 3223 | [操作后字符串的最短长度](/solution/3200-3299/3223.Minimum%20Length%20of%20String%20After%20Operations/README.md) | `哈希表`,`字符串`,`计数` | 中等 | 第 135 场双周赛 |
32373237
| 3224 | [使差值相等的最少数组改动次数](/solution/3200-3299/3224.Minimum%20Array%20Changes%20to%20Make%20Differences%20Equal/README.md) | `数组`,`哈希表`,`前缀和` | 中等 | 第 135 场双周赛 |

solution/contest.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)