Skip to content

Commit 98abe13

Browse files
authored
feat: update lc problems (#3254)
1 parent 9c9f3a6 commit 98abe13

File tree

13 files changed

+30
-20
lines changed

13 files changed

+30
-20
lines changed

solution/0100-0199/0130.Surrounded Regions/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tags:
2424

2525
<ul>
2626
<li><strong>连接:</strong>一个单元格与水平或垂直方向上相邻的单元格连接。</li>
27-
<li><strong>区域:连接所有&nbsp;</strong><code>'0'</code>&nbsp;的单元格来形成一个区域。</li>
27+
<li><strong>区域:连接所有&nbsp;</strong><code>'O'</code>&nbsp;的单元格来形成一个区域。</li>
2828
<li><strong>围绕:</strong>如果您可以用&nbsp;<code>'X'</code>&nbsp;单元格 <strong>连接这个区域</strong>,并且区域中没有任何单元格位于&nbsp;<code>board</code> 边缘,则该区域被 <code>'X'</code>&nbsp;单元格围绕。</li>
2929
</ul>
3030

solution/0600-0699/0683.K Empty Slots/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0683.K%20Empty%20Slots/README.md
55
tags:
66
- 树状数组
7+
- 线段树
8+
- 队列
79
- 数组
810
- 有序集合
911
- 滑动窗口
12+
- 单调队列
13+
- 堆(优先队列)
1014
---
1115

1216
<!-- problem:start -->

solution/0600-0699/0683.K Empty Slots/README_EN.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0683.K%20Empty%20Slots/README_EN.md
55
tags:
66
- Binary Indexed Tree
7+
- Segment Tree
8+
- Queue
79
- Array
810
- Ordered Set
911
- Sliding Window
12+
- Monotonic Queue
13+
- Heap (Priority Queue)
1014
---
1115

1216
<!-- problem:start -->

solution/1300-1399/1395.Count Number of Teams/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ tags:
2020

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

23-
<p> <code>n</code> 名士兵站成一排。每个士兵都有一个 <strong>独一无二</strong> 的评分 <code>rating</code> 。</p>
23+
<p>&nbsp;<code>n</code> 名士兵站成一排。每个士兵都有一个 <strong>独一无二</strong> 的评分 <code>rating</code> 。</p>
2424

25-
<p> <strong>3</strong> 个士兵可以组成一个作战单位,分组规则如下:</p>
25+
<p>从中选出 <strong>3</strong> 个士兵组成一个作战单位,规则如下:</p>
2626

2727
<ul>
2828
<li>从队伍中选出下标分别为 <code>i</code>、<code>j</code>、<code>k</code> 的 3 名士兵,他们的评分分别为 <code>rating[i]</code>、<code>rating[j]</code>、<code>rating[k]</code></li>
29-
<li>作战单位需满足: <code>rating[i] < rating[j] < rating[k]</code> 或者 <code>rating[i] > rating[j] > rating[k]</code> ,其中  <code>0 <= i < j < k < n</code></li>
29+
<li>作战单位需满足: <code>rating[i] &lt; rating[j] &lt; rating[k]</code> 或者 <code>rating[i] &gt; rating[j] &gt; rating[k]</code> ,其中&nbsp; <code>0&nbsp;&lt;= i &lt;&nbsp;j &lt;&nbsp;k &lt;&nbsp;n</code></li>
3030
</ul>
3131

32-
<p>请你返回按上述条件可以组建的作战单位数量。每个士兵都可以是多个作战单位的一部分。</p>
32+
<p>请你返回按上述条件组建的作战单位的方案数。</p>
3333

34-
<p> </p>
34+
<p>&nbsp;</p>
3535

3636
<p><strong>示例 1:</strong></p>
3737

@@ -56,15 +56,15 @@ tags:
5656
<strong>输出:</strong>4
5757
</pre>
5858

59-
<p> </p>
59+
<p>&nbsp;</p>
6060

6161
<p><strong>提示:</strong></p>
6262

6363
<ul>
6464
<li><code>n == rating.length</code></li>
65-
<li><code>3 <= n <= 1000</code></li>
66-
<li><code>1 <= rating[i] <= 10^5</code></li>
67-
<li><code>rating</code> 中的元素都是唯一的</li>
65+
<li><code>3 &lt;= n &lt;= 1000</code></li>
66+
<li><code>1 &lt;= rating[i] &lt;= 10^5</code></li>
67+
<li><code>rating</code>&nbsp;中的元素都是唯一的</li>
6868
</ul>
6969

7070
<!-- description:end -->

solution/1500-1599/1515.Best Position for a Service Centre/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ rating: 2156
66
source: 第 197 场周赛 Q4
77
tags:
88
- 几何
9+
- 数组
910
- 数学
1011
- 随机化
1112
---

solution/1500-1599/1515.Best Position for a Service Centre/README_EN.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ rating: 2156
66
source: Weekly Contest 197 Q4
77
tags:
88
- Geometry
9+
- Array
910
- Math
1011
- Randomized
1112
---

solution/3000-3099/3086.Minimum Moves to Pick K Ones/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tags:
4444
<p><strong>解释:</strong>如果游戏开始时&nbsp;Alice 在 <code>aliceIndex == 1</code> 的位置上,按照以下步骤执行每个动作,他可以利用 <code>3</code> 次行动拾取 <code>3</code> 个 1 :</p>
4545

4646
<ul>
47-
<li>游戏开始时&nbsp;Alice 拾取了一个 1 ,<code>nums[1]</code> 变成了 <code>0</code>。此时 <code>nums</code> 变为 <code>[1,<strong><u>0</u></strong>,1,0,0,1,1,0,0,1]</code> 。</li>
47+
<li>游戏开始时&nbsp;Alice 拾取了一个 1 ,<code>nums[1]</code> 变成了 <code>0</code>。此时 <code>nums</code> 变为 <code>[1,<strong><u>0</u></strong>,0,0,0,1,1,0,0,1]</code> 。</li>
4848
<li>选择 <code>j == 2</code> 并执行第一种类型的动作。<code>nums</code> 变为 <code>[1,<strong><u>0</u></strong>,1,0,0,1,1,0,0,1]</code></li>
4949
<li>选择 <code>x == 2</code> 和 <code>y == 1</code> ,并执行第二种类型的动作。<code>nums</code> 变为 <code>[1,<strong><u>1</u></strong>,0,0,0,1,1,0,0,1]</code> 。由于 <code>y == aliceIndex</code>,Alice 拾取了一个 1 ,<code>nums</code> 变为&nbsp; <code>[1,<strong><u>0</u></strong>,0,0,0,1,1,0,0,1]</code> 。</li>
5050
<li>选择 <code>x == 0</code> 和 <code>y == 1</code> ,并执行第二种类型的动作。<code>nums</code> 变为 <code>[0,<strong><u>1</u></strong>,0,0,0,1,1,0,0,1]</code> 。由于 <code>y == aliceIndex</code>,Alice 拾取了一个 1 ,<code>nums</code> 变为&nbsp; <code>[0,<strong><u>0</u></strong>,0,0,0,1,1,0,0,1]</code> 。</li>

solution/3000-3099/3098.Find the Sum of Subsequence Powers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tags:
2222

2323
<p>给你一个长度为 <code>n</code>&nbsp;的整数数组&nbsp;<code>nums</code>&nbsp;和一个 <strong>正</strong>&nbsp;整数&nbsp;<code>k</code>&nbsp;。</p>
2424

25-
<p>一个子序列的 <strong>能量</strong>&nbsp;定义为子序列中&nbsp;<strong>任意</strong>&nbsp;两个元素的差值绝对值的 <strong>最小值</strong>&nbsp;。</p>
25+
<p>一个 <span data-keyword="subsequence-array">子序列</span> 的 <strong>能量</strong>&nbsp;定义为子序列中&nbsp;<strong>任意</strong>&nbsp;两个元素的差值绝对值的 <strong>最小值</strong>&nbsp;。</p>
2626

2727
<p>请你返回 <code>nums</code>&nbsp;中长度 <strong>等于</strong>&nbsp;<code>k</code>&nbsp;的 <strong>所有</strong>&nbsp;子序列的 <strong>能量和</strong>&nbsp;。</p>
2828

solution/3200-3299/3212.Count Submatrices With Equal Frequency of X and Y/README_EN.md

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

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

21-
<p>Given a 2D character matrix <code>grid</code>, where <code>grid[i][j]</code> is either <code>&#39;X&#39;</code>, <code>&#39;Y&#39;</code>, or <code>&#39;.&#39;</code>, return the number of <span data-keyword="submatrix">submatrices</span> that contains:</p>
21+
<p>Given a 2D character matrix <code>grid</code>, where <code>grid[i][j]</code> is either <code>&#39;X&#39;</code>, <code>&#39;Y&#39;</code>, or <code>&#39;.&#39;</code>, return the number of <span data-keyword="submatrix">submatrices</span> that contain:</p>
2222

2323
<ul>
2424
<li><code>grid[0][0]</code></li>

solution/CONTEST_README.md

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

2727
## 往期竞赛
2828

29-
#### 第 405 场周赛(2024-07-07 10:30, 90 分钟) 参赛人数 3239
29+
#### 第 405 场周赛(2024-07-07 10:30, 90 分钟) 参赛人数 3240
3030

3131
- [3210. 找出加密后的字符串](/solution/3200-3299/3210.Find%20the%20Encrypted%20String/README.md)
3232
- [3211. 生成不含相邻零的二进制字符串](/solution/3200-3299/3211.Generate%20Binary%20Strings%20Without%20Adjacent%20Zeros/README.md)
@@ -145,7 +145,7 @@ comments: true
145145
- [3129. 找出所有稳定的二进制数组 I](/solution/3100-3199/3129.Find%20All%20Possible%20Stable%20Binary%20Arrays%20I/README.md)
146146
- [3130. 找出所有稳定的二进制数组 II](/solution/3100-3199/3130.Find%20All%20Possible%20Stable%20Binary%20Arrays%20II/README.md)
147147

148-
#### 第 394 场周赛(2024-04-21 10:30, 90 分钟) 参赛人数 3957
148+
#### 第 394 场周赛(2024-04-21 10:30, 90 分钟) 参赛人数 3958
149149

150150
- [3120. 统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md)
151151
- [3121. 统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md)

solution/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@
693693
| 0680 | [验证回文串 II](/solution/0600-0699/0680.Valid%20Palindrome%20II/README.md) | `贪心`,`双指针`,`字符串` | 简单 | |
694694
| 0681 | [最近时刻](/solution/0600-0699/0681.Next%20Closest%20Time/README.md) | `哈希表`,`字符串`,`回溯`,`枚举` | 中等 | 🔒 |
695695
| 0682 | [棒球比赛](/solution/0600-0699/0682.Baseball%20Game/README.md) | `栈`,`数组`,`模拟` | 简单 | |
696-
| 0683 | [K 个关闭的灯泡](/solution/0600-0699/0683.K%20Empty%20Slots/README.md) | `树状数组`,`数组`,`有序集合`,`滑动窗口` | 困难 | 🔒 |
696+
| 0683 | [K 个关闭的灯泡](/solution/0600-0699/0683.K%20Empty%20Slots/README.md) | `树状数组`,`线段树`,`队列`,`数组`,`有序集合`,`滑动窗口`,`单调队列`,`堆(优先队列)` | 困难 | 🔒 |
697697
| 0684 | [冗余连接](/solution/0600-0699/0684.Redundant%20Connection/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图` | 中等 | |
698698
| 0685 | [冗余连接 II](/solution/0600-0699/0685.Redundant%20Connection%20II/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图` | 困难 | |
699699
| 0686 | [重复叠加字符串匹配](/solution/0600-0699/0686.Repeated%20String%20Match/README.md) | `字符串`,`字符串匹配` | 中等 | |
@@ -1525,7 +1525,7 @@
15251525
| 1512 | [好数对的数目](/solution/1500-1599/1512.Number%20of%20Good%20Pairs/README.md) | `数组`,`哈希表`,`数学`,`计数` | 简单 | 第 197 场周赛 |
15261526
| 1513 | [仅含 1 的子串数](/solution/1500-1599/1513.Number%20of%20Substrings%20With%20Only%201s/README.md) | `数学`,`字符串` | 中等 | 第 197 场周赛 |
15271527
| 1514 | [概率最大的路径](/solution/1500-1599/1514.Path%20with%20Maximum%20Probability/README.md) | `图`,`数组`,`最短路`,`堆(优先队列)` | 中等 | 第 197 场周赛 |
1528-
| 1515 | [服务中心的最佳位置](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README.md) | `几何`,`数学`,`随机化` | 困难 | 第 197 场周赛 |
1528+
| 1515 | [服务中心的最佳位置](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README.md) | `几何`,`数组`,`数学`,`随机化` | 困难 | 第 197 场周赛 |
15291529
| 1516 | [移动 N 叉树的子树](/solution/1500-1599/1516.Move%20Sub-Tree%20of%20N-Ary%20Tree/README.md) | `树`,`深度优先搜索` | 困难 | 🔒 |
15301530
| 1517 | [查找拥有有效邮箱的用户](/solution/1500-1599/1517.Find%20Users%20With%20Valid%20E-Mails/README.md) | `数据库` | 简单 | |
15311531
| 1518 | [换水问题](/solution/1500-1599/1518.Water%20Bottles/README.md) | `数学`,`模拟` | 简单 | 第 198 场周赛 |

solution/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
691691
| 0680 | [Valid Palindrome II](/solution/0600-0699/0680.Valid%20Palindrome%20II/README_EN.md) | `Greedy`,`Two Pointers`,`String` | Easy | |
692692
| 0681 | [Next Closest Time](/solution/0600-0699/0681.Next%20Closest%20Time/README_EN.md) | `Hash Table`,`String`,`Backtracking`,`Enumeration` | Medium | 🔒 |
693693
| 0682 | [Baseball Game](/solution/0600-0699/0682.Baseball%20Game/README_EN.md) | `Stack`,`Array`,`Simulation` | Easy | |
694-
| 0683 | [K Empty Slots](/solution/0600-0699/0683.K%20Empty%20Slots/README_EN.md) | `Binary Indexed Tree`,`Array`,`Ordered Set`,`Sliding Window` | Hard | 🔒 |
694+
| 0683 | [K Empty Slots](/solution/0600-0699/0683.K%20Empty%20Slots/README_EN.md) | `Binary Indexed Tree`,`Segment Tree`,`Queue`,`Array`,`Ordered Set`,`Sliding Window`,`Monotonic Queue`,`Heap (Priority Queue)` | Hard | 🔒 |
695695
| 0684 | [Redundant Connection](/solution/0600-0699/0684.Redundant%20Connection/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Union Find`,`Graph` | Medium | |
696696
| 0685 | [Redundant Connection II](/solution/0600-0699/0685.Redundant%20Connection%20II/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Union Find`,`Graph` | Hard | |
697697
| 0686 | [Repeated String Match](/solution/0600-0699/0686.Repeated%20String%20Match/README_EN.md) | `String`,`String Matching` | Medium | |
@@ -1523,7 +1523,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
15231523
| 1512 | [Number of Good Pairs](/solution/1500-1599/1512.Number%20of%20Good%20Pairs/README_EN.md) | `Array`,`Hash Table`,`Math`,`Counting` | Easy | Weekly Contest 197 |
15241524
| 1513 | [Number of Substrings With Only 1s](/solution/1500-1599/1513.Number%20of%20Substrings%20With%20Only%201s/README_EN.md) | `Math`,`String` | Medium | Weekly Contest 197 |
15251525
| 1514 | [Path with Maximum Probability](/solution/1500-1599/1514.Path%20with%20Maximum%20Probability/README_EN.md) | `Graph`,`Array`,`Shortest Path`,`Heap (Priority Queue)` | Medium | Weekly Contest 197 |
1526-
| 1515 | [Best Position for a Service Centre](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README_EN.md) | `Geometry`,`Math`,`Randomized` | Hard | Weekly Contest 197 |
1526+
| 1515 | [Best Position for a Service Centre](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README_EN.md) | `Geometry`,`Array`,`Math`,`Randomized` | Hard | Weekly Contest 197 |
15271527
| 1516 | [Move Sub-Tree of N-Ary Tree](/solution/1500-1599/1516.Move%20Sub-Tree%20of%20N-Ary%20Tree/README_EN.md) | `Tree`,`Depth-First Search` | Hard | 🔒 |
15281528
| 1517 | [Find Users With Valid E-Mails](/solution/1500-1599/1517.Find%20Users%20With%20Valid%20E-Mails/README_EN.md) | `Database` | Easy | |
15291529
| 1518 | [Water Bottles](/solution/1500-1599/1518.Water%20Bottles/README_EN.md) | `Math`,`Simulation` | Easy | Weekly Contest 198 |

solution/contest.json

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

0 commit comments

Comments
 (0)