Skip to content

feat: update lc problems #3254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion solution/0100-0199/0130.Surrounded Regions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tags:

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

Expand Down
4 changes: 4 additions & 0 deletions solution/0600-0699/0683.K Empty Slots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0683.K%20Empty%20Slots/README.md
tags:
- 树状数组
- 线段树
- 队列
- 数组
- 有序集合
- 滑动窗口
- 单调队列
- 堆(优先队列)
---

<!-- problem:start -->
Expand Down
4 changes: 4 additions & 0 deletions solution/0600-0699/0683.K Empty Slots/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0683.K%20Empty%20Slots/README_EN.md
tags:
- Binary Indexed Tree
- Segment Tree
- Queue
- Array
- Ordered Set
- Sliding Window
- Monotonic Queue
- Heap (Priority Queue)
---

<!-- problem:start -->
Expand Down
18 changes: 9 additions & 9 deletions solution/1300-1399/1395.Count Number of Teams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ tags:

<!-- description:start -->

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

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

<ul>
<li>从队伍中选出下标分别为 <code>i</code>、<code>j</code>、<code>k</code> 的 3 名士兵,他们的评分分别为 <code>rating[i]</code>、<code>rating[j]</code>、<code>rating[k]</code></li>
<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>
<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>
</ul>

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

<p> </p>
<p>&nbsp;</p>

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

Expand All @@ -56,15 +56,15 @@ tags:
<strong>输出:</strong>4
</pre>

<p> </p>
<p>&nbsp;</p>

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

<ul>
<li><code>n == rating.length</code></li>
<li><code>3 <= n <= 1000</code></li>
<li><code>1 <= rating[i] <= 10^5</code></li>
<li><code>rating</code> 中的元素都是唯一的</li>
<li><code>3 &lt;= n &lt;= 1000</code></li>
<li><code>1 &lt;= rating[i] &lt;= 10^5</code></li>
<li><code>rating</code>&nbsp;中的元素都是唯一的</li>
</ul>

<!-- description:end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rating: 2156
source: 第 197 场周赛 Q4
tags:
- 几何
- 数组
- 数学
- 随机化
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rating: 2156
source: Weekly Contest 197 Q4
tags:
- Geometry
- Array
- Math
- Randomized
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tags:
<p><strong>解释:</strong>如果游戏开始时&nbsp;Alice 在 <code>aliceIndex == 1</code> 的位置上,按照以下步骤执行每个动作,他可以利用 <code>3</code> 次行动拾取 <code>3</code> 个 1 :</p>

<ul>
<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>
<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>
<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>
<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>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tags:

<!-- description:start -->

<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>
<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>

<ul>
<li><code>grid[0][0]</code></li>
Expand Down
4 changes: 2 additions & 2 deletions solution/CONTEST_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ comments: true

## 往期竞赛

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

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

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

- [3120. 统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md)
- [3121. 统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md)
Expand Down
4 changes: 2 additions & 2 deletions solution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@
| 0680 | [验证回文串 II](/solution/0600-0699/0680.Valid%20Palindrome%20II/README.md) | `贪心`,`双指针`,`字符串` | 简单 | |
| 0681 | [最近时刻](/solution/0600-0699/0681.Next%20Closest%20Time/README.md) | `哈希表`,`字符串`,`回溯`,`枚举` | 中等 | 🔒 |
| 0682 | [棒球比赛](/solution/0600-0699/0682.Baseball%20Game/README.md) | `栈`,`数组`,`模拟` | 简单 | |
| 0683 | [K 个关闭的灯泡](/solution/0600-0699/0683.K%20Empty%20Slots/README.md) | `树状数组`,`数组`,`有序集合`,`滑动窗口` | 困难 | 🔒 |
| 0683 | [K 个关闭的灯泡](/solution/0600-0699/0683.K%20Empty%20Slots/README.md) | `树状数组`,`线段树`,`队列`,`数组`,`有序集合`,`滑动窗口`,`单调队列`,`堆(优先队列)` | 困难 | 🔒 |
| 0684 | [冗余连接](/solution/0600-0699/0684.Redundant%20Connection/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图` | 中等 | |
| 0685 | [冗余连接 II](/solution/0600-0699/0685.Redundant%20Connection%20II/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图` | 困难 | |
| 0686 | [重复叠加字符串匹配](/solution/0600-0699/0686.Repeated%20String%20Match/README.md) | `字符串`,`字符串匹配` | 中等 | |
Expand Down Expand Up @@ -1525,7 +1525,7 @@
| 1512 | [好数对的数目](/solution/1500-1599/1512.Number%20of%20Good%20Pairs/README.md) | `数组`,`哈希表`,`数学`,`计数` | 简单 | 第 197 场周赛 |
| 1513 | [仅含 1 的子串数](/solution/1500-1599/1513.Number%20of%20Substrings%20With%20Only%201s/README.md) | `数学`,`字符串` | 中等 | 第 197 场周赛 |
| 1514 | [概率最大的路径](/solution/1500-1599/1514.Path%20with%20Maximum%20Probability/README.md) | `图`,`数组`,`最短路`,`堆(优先队列)` | 中等 | 第 197 场周赛 |
| 1515 | [服务中心的最佳位置](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README.md) | `几何`,`数学`,`随机化` | 困难 | 第 197 场周赛 |
| 1515 | [服务中心的最佳位置](/solution/1500-1599/1515.Best%20Position%20for%20a%20Service%20Centre/README.md) | `几何`,`数组`,`数学`,`随机化` | 困难 | 第 197 场周赛 |
| 1516 | [移动 N 叉树的子树](/solution/1500-1599/1516.Move%20Sub-Tree%20of%20N-Ary%20Tree/README.md) | `树`,`深度优先搜索` | 困难 | 🔒 |
| 1517 | [查找拥有有效邮箱的用户](/solution/1500-1599/1517.Find%20Users%20With%20Valid%20E-Mails/README.md) | `数据库` | 简单 | |
| 1518 | [换水问题](/solution/1500-1599/1518.Water%20Bottles/README.md) | `数学`,`模拟` | 简单 | 第 198 场周赛 |
Expand Down
4 changes: 2 additions & 2 deletions solution/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
| 0680 | [Valid Palindrome II](/solution/0600-0699/0680.Valid%20Palindrome%20II/README_EN.md) | `Greedy`,`Two Pointers`,`String` | Easy | |
| 0681 | [Next Closest Time](/solution/0600-0699/0681.Next%20Closest%20Time/README_EN.md) | `Hash Table`,`String`,`Backtracking`,`Enumeration` | Medium | 🔒 |
| 0682 | [Baseball Game](/solution/0600-0699/0682.Baseball%20Game/README_EN.md) | `Stack`,`Array`,`Simulation` | Easy | |
| 0683 | [K Empty Slots](/solution/0600-0699/0683.K%20Empty%20Slots/README_EN.md) | `Binary Indexed Tree`,`Array`,`Ordered Set`,`Sliding Window` | Hard | 🔒 |
| 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 | 🔒 |
| 0684 | [Redundant Connection](/solution/0600-0699/0684.Redundant%20Connection/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Union Find`,`Graph` | Medium | |
| 0685 | [Redundant Connection II](/solution/0600-0699/0685.Redundant%20Connection%20II/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Union Find`,`Graph` | Hard | |
| 0686 | [Repeated String Match](/solution/0600-0699/0686.Repeated%20String%20Match/README_EN.md) | `String`,`String Matching` | Medium | |
Expand Down Expand Up @@ -1523,7 +1523,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 | 🔒 |
| 1517 | [Find Users With Valid E-Mails](/solution/1500-1599/1517.Find%20Users%20With%20Valid%20E-Mails/README_EN.md) | `Database` | Easy | |
| 1518 | [Water Bottles](/solution/1500-1599/1518.Water%20Bottles/README_EN.md) | `Math`,`Simulation` | Easy | Weekly Contest 198 |
Expand Down
2 changes: 1 addition & 1 deletion solution/contest.json

Large diffs are not rendered by default.

Loading