Skip to content

Commit b243a20

Browse files
authored
feat: update lc problems (#2008)
1 parent 9480261 commit b243a20

File tree

14 files changed

+57
-53
lines changed

14 files changed

+57
-53
lines changed

solution/0500-0599/0570.Managers with at Least 5 Direct Reports/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
| department | varchar |
1818
| managerId | int |
1919
+-------------+---------+
20-
在 SQL 中,id 是该表的主键列
21-
该表的每一行都表示雇员的名字、他们的部门和他们的经理的id。
20+
id 是此表的主键(具有唯一值的列)
21+
该表的每一行表示雇员的名字、他们的部门和他们的经理的id。
2222
如果managerId为空,则该员工没有经理。
2323
没有员工会成为自己的管理者。
2424
</pre>
2525

2626
<p>&nbsp;</p>
2727

28-
<p>查询<strong>至少有5名直接下属</strong>的经理<strong> </strong>。</p>
28+
<p>编写一个解决方案,找出至少有<strong>五个直接下属</strong>的经理。</p>
2929

3030
<p>以 <strong>任意顺序 </strong>返回结果表。</p>
3131

@@ -41,7 +41,7 @@ Employee 表:
4141
+-----+-------+------------+-----------+
4242
| id | name | department | managerId |
4343
+-----+-------+------------+-----------+
44-
| 101 | John | A | None |
44+
| 101 | John | A | Null |
4545
| 102 | Dan | A | 101 |
4646
| 103 | James | A | 101 |
4747
| 104 | Amy | A | 101 |

solution/0500-0599/0570.Managers with at Least 5 Direct Reports/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Employee table:
3838
+-----+-------+------------+-----------+
3939
| id | name | department | managerId |
4040
+-----+-------+------------+-----------+
41-
| 101 | John | A | None |
41+
| 101 | John | A | null |
4242
| 102 | Dan | A | 101 |
4343
| 103 | James | A | 101 |
4444
| 104 | Amy | A | 101 |

solution/0700-0799/0700.Search in a Binary Search Tree/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<p><strong>提示:</strong></p>
3434

3535
<ul>
36-
<li>数中节点数在&nbsp;<code>[1, 5000]</code>&nbsp;范围内</li>
36+
<li>树中节点数在&nbsp;<code>[1, 5000]</code>&nbsp;范围内</li>
3737
<li><code>1 &lt;= Node.val &lt;= 10<sup>7</sup></code></li>
3838
<li><code>root</code>&nbsp;是二叉搜索树</li>
3939
<li><code>1 &lt;= val &lt;= 10<sup>7</sup></code></li>

solution/0800-0899/0815.Bus Routes/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
<strong>Output:</strong> -1
3131
</pre>
3232

33+
<p>&nbsp;</p>
34+
3335
<p>&nbsp;</p>
3436
<p><strong>Constraints:</strong></p>
3537

solution/1200-1299/1293.Shortest Path in a Grid with Obstacles Elimination/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

17-
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1293.Shortest%20Path%20in%20a%20Grid%20with%20Obstacles%20Elimination/images/short1-grid.jpg" /></p>
17+
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1293.Shortest%20Path%20in%20a%20Grid%20with%20Obstacles%20Elimination/images/1700710956-kcxqcC-img_v3_025f_d55a658c-8f40-464b-800f-22ccd27cc9fg.jpg" style="width: 243px; height: 404px;" /></p>
1818

1919
<pre>
2020
<strong>输入:</strong> grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1
@@ -26,7 +26,7 @@
2626

2727
<p><strong>示例 2:</strong></p>
2828

29-
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1293.Shortest%20Path%20in%20a%20Grid%20with%20Obstacles%20Elimination/images/short2-grid.jpg" /></p>
29+
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1293.Shortest%20Path%20in%20a%20Grid%20with%20Obstacles%20Elimination/images/1700710701-uPqkZe-img_v3_025f_0edd50fb-8a70-4a42-add0-f602caaad35g.jpg" style="width: 243px; height: 244px;" /></p>
3030

3131
<pre>
3232
<strong>输入:</strong>grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1

solution/1700-1799/1759.Count Number of Homogenous Substrings/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
<ul>
5151
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
52-
<li><code>s</code> 由小写字符串组成</li>
52+
<li><code>s</code> 由小写字符串组成</li>
5353
</ul>
5454

5555
## 解法

solution/1800-1899/1846.Maximum Element After Decreasing and Rearranging/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ One possible way to satisfy the conditions is by doing the following:
4141
1. Rearrange <code>arr</code> so it becomes <code>[1,100,1000]</code>.
4242
2. Decrease the value of the second element to 2.
4343
3. Decrease the value of the third element to 3.
44-
Now <code>arr = [1,2,3], which </code>satisfies the conditions.
44+
Now <code>arr = [1,2,3]</code>, which<code> </code>satisfies the conditions.
4545
The largest element in <code>arr is 3.</code>
4646
</pre>
4747

solution/2900-2999/2936.Number of Equal Numbers Blocks/README.md

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
1-
# [2936. Number of Equal Numbers Blocks](https://leetcode.cn/problems/number-of-equal-numbers-blocks)
1+
# [2936. 包含相等值数字块的数量](https://leetcode.cn/problems/number-of-equal-numbers-blocks)
22

33
[English Version](/solution/2900-2999/2936.Number%20of%20Equal%20Numbers%20Blocks/README_EN.md)
44

55
## 题目描述
66

77
<!-- 这里写题目描述 -->
88

9-
<p>You are given a <strong>0-indexed</strong> array of integers, <code>nums</code>. The following property holds for <code>nums</code>:</p>
9+
<p>给定一个整数数组 <code>nums</code>,其&nbsp;<strong>下标从 0 开始</strong>。对于 <code>nums</code>,有以下性质:</p>
1010

1111
<ul>
12-
<li>All occurrences of a value are adjacent. In other words, if there are two indices <code>i &lt; j</code> such that <code>nums[i] == nums[j]</code>, then for every index <code>k</code> that <code>i &lt; k &lt; j</code>, <code>nums[k] == nums[i]</code>.</li>
12+
<li>所有相同值的元素都是相邻的。换句话说,如果存在两个下标 <code>i &lt; j</code>,使得 <code>nums[i] == nums[j]</code>,那么对于所有下标 <code>k</code>,满足 <code>i &lt; k &lt; j</code>,都有 <code>nums[k] == nums[i]</code></li>
1313
</ul>
1414

15-
<p>Since <code>nums</code> is a very large array, you are given an instance of the class <code>BigArray</code> which has the following functions:</p>
15+
<p>由于 <code>nums</code> 是一个非常大的数组,这里提供了一个 <code>BigArray</code> 类的实例,该实例具有以下函数:</p>
1616

1717
<ul>
18-
<li><code>int at(long long index)</code>: Returns the value of <code>nums[i]</code>.</li>
19-
<li><code>void size()</code>: Returns <code>nums.length</code>.</li>
18+
<li><code>int at(long long index)</code>: 返回 <code>nums[i]</code> 的值。</li>
19+
<li><code>void size()</code>: 返回 <code>nums.length</code></li>
2020
</ul>
2121

22-
<p>Let&#39;s partition the array into <strong>maximal</strong> blocks such that each block contains <strong>equal values</strong>. Return<em> the number of these blocks.</em></p>
22+
<p>让我们把数组分成 <strong>最大</strong>&nbsp;的块,使得每个块包含 <strong>相等的值</strong>。返回这些块的数量。</p>
2323

24-
<p><strong>Note</strong> that if you want to test your solution using a custom test, behavior for tests with <code>nums.length &gt; 10</code> is undefined.</p>
24+
<p><strong>请注意</strong>,如果要使用自定义测试测试解决方案,对于 <code>nums.length &gt; 10</code> 的测试行为是未定义的。</p>
2525

2626
<p>&nbsp;</p>
27-
<p><strong class="example">Example 1:</strong></p>
27+
28+
<p><strong>示例 1:</strong></p>
2829

2930
<pre>
30-
<strong>Input:</strong> nums = [3,3,3,3,3]
31-
<strong>Output:</strong> 1
32-
<strong>Explanation:</strong> There is only one block here which is the whole array (because all numbers are equal) and that is: [<u>3,3,3,3,3</u>]. So the answer would be 1.
31+
<b>输入:</b>nums = [3,3,3,3,3]
32+
<b>输出:</b>1
33+
<b>解释:</b>这里只有一个块,即整个数组(因为所有数字都相等),即:[3,3,3,3,3]。因此答案是 1。
3334
</pre>
3435

35-
<p><strong class="example">Example 2:</strong></p>
36+
<p><b>示例 2:</b></p>
3637

3738
<pre>
38-
<strong>Input:</strong> nums = [1,1,1,3,9,9,9,2,10,10]
39-
<strong>Output:</strong> 5
40-
<strong>Explanation:</strong> There are 5 blocks here:
41-
Block number 1: [<u>1,1,1</u>,3,9,9,9,2,10,10]
42-
Block number 2: [1,1,1,<u>3</u>,9,9,9,2,10,10]
43-
Block number 3: [1,1,1,3,<u>9,9,9</u>,2,10,10]
44-
Block number 4: [1,1,1,3,9,9,9,<u>2</u>,10,10]
45-
Block number 5: [1,1,1,3,9,9,9,2,<u>10,10</u>]
46-
So the answer would be 5.</pre>
47-
48-
<p><strong class="example">Example 3:</strong></p>
39+
<b>输入:</b>nums = [1,1,1,3,9,9,9,2,10,10]
40+
<b>输出:</b>5
41+
<b>解释:</b>这里有 5 个块:
42+
块号 1: [<u>1,1,1</u>,3,9,9,9,2,10,10]
43+
块号 2: [1,1,1,<u>3</u>,9,9,9,2,10,10]
44+
块号 3: [1,1,1,3,<u>9,9,9</u>,2,10,10]
45+
块号 4: [1,1,1,3,9,9,9,<u>2</u>,10,10]
46+
块号 5: [1,1,1,3,9,9,9,2,<u>10,10</u>]
47+
因此答案是 5。</pre>
48+
49+
<p><strong class="example">示例 3:</strong></p>
4950

5051
<pre>
51-
<strong>Input:</strong> nums = [1,2,3,4,5,6,7]
52-
<strong>Output:</strong> 7
53-
<strong>Explanation:</strong> Since all numbers are distinct, there are 7 blocks here and each element representing one block. So the answer would be 7.
52+
<b>输入:</b>nums = [1,2,3,4,5,6,7]
53+
<b>输出:</b>7
54+
<b>解释:</b>由于所有数字都是不同的,这里有 7 个块,每个元素代表一个块。因此答案是 7。
5455
</pre>
5556

5657
<p>&nbsp;</p>
57-
<p><strong>Constraints:</strong></p>
58+
59+
<p><strong>提示:</strong></p>
5860

5961
<ul>
6062
<li><code>1 &lt;= nums.length &lt;= 10<sup>15</sup></code></li>
6163
<li><code>1 &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
62-
<li>The input is generated such that all equal values are adjacent.</li>
63-
<li>The sum of the elements of&nbsp;<code>nums</code>&nbsp;is at most&nbsp;<code>10<sup>15</sup></code>.</li>
64+
<li>在生成的输入中所有相同值的元素是相邻的。</li>
65+
<li><code>nums</code> 的所有元素之和最多为<meta charset="UTF-8" />&nbsp;<code>10<sup>15</sup></code></li>
6466
</ul>
6567

6668
## 解法

solution/CONTEST_README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
- [2780. 合法分割的最小下标](/solution/2700-2799/2780.Minimum%20Index%20of%20a%20Valid%20Split/README.md)
219219
- [2781. 最长合法子字符串的长度](/solution/2700-2799/2781.Length%20of%20the%20Longest%20Valid%20Substring/README.md)
220220

221-
#### 第 353 场周赛(2023-07-09 10:30, 90 分钟) 参赛人数 4112
221+
#### 第 353 场周赛(2023-07-09 10:30, 90 分钟) 参赛人数 4113
222222

223223
- [2769. 找出最大的可达成数字](/solution/2700-2799/2769.Find%20the%20Maximum%20Achievable%20Number/README.md)
224224
- [2770. 达到末尾下标所需的最大跳跃次数](/solution/2700-2799/2770.Maximum%20Number%20of%20Jumps%20to%20Reach%20the%20Last%20Index/README.md)

solution/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2946,11 +2946,11 @@
29462946
| 2933 | [高访问员工](/solution/2900-2999/2933.High-Access%20Employees/README.md) | `数组`,`哈希表`,`字符串`,`排序` | 中等 | 第 371 场周赛 |
29472947
| 2934 | [最大化数组末位元素的最少操作次数](/solution/2900-2999/2934.Minimum%20Operations%20to%20Maximize%20Last%20Elements%20in%20Arrays/README.md) | `贪心`,`数组` | 中等 | 第 371 场周赛 |
29482948
| 2935 | [找出强数对的最大异或值 II](/solution/2900-2999/2935.Maximum%20Strong%20Pair%20XOR%20II/README.md) | `位运算`,`字典树`,`数组`,`哈希表`,`滑动窗口` | 困难 | 第 371 场周赛 |
2949-
| 2936 | [包含相等值数字块的数量](/solution/2900-2999/2936.Number%20of%20Equal%20Numbers%20Blocks/README.md) | | 中等 | 🔒 |
2950-
| 2937 | [使三个字符串相等](/solution/2900-2999/2937.Make%20Three%20Strings%20Equal/README.md) | | 简单 | 第 372 场周赛 |
2951-
| 2938 | [区分黑球与白球](/solution/2900-2999/2938.Separate%20Black%20and%20White%20Balls/README.md) | | 中等 | 第 372 场周赛 |
2952-
| 2939 | [最大异或乘积](/solution/2900-2999/2939.Maximum%20Xor%20Product/README.md) | | 中等 | 第 372 场周赛 |
2953-
| 2940 | [找到 Alice 和 Bob 可以相遇的建筑](/solution/2900-2999/2940.Find%20Building%20Where%20Alice%20and%20Bob%20Can%20Meet/README.md) | | 困难 | 第 372 场周赛 |
2949+
| 2936 | [包含相等值数字块的数量](/solution/2900-2999/2936.Number%20of%20Equal%20Numbers%20Blocks/README.md) | `数组`,`二分查找`,`分治` | 中等 | 🔒 |
2950+
| 2937 | [使三个字符串相等](/solution/2900-2999/2937.Make%20Three%20Strings%20Equal/README.md) | `字符串` | 简单 | 第 372 场周赛 |
2951+
| 2938 | [区分黑球与白球](/solution/2900-2999/2938.Separate%20Black%20and%20White%20Balls/README.md) | `贪心`,`双指针`,`字符串` | 中等 | 第 372 场周赛 |
2952+
| 2939 | [最大异或乘积](/solution/2900-2999/2939.Maximum%20Xor%20Product/README.md) | `贪心`,`位运算`,`数学` | 中等 | 第 372 场周赛 |
2953+
| 2940 | [找到 Alice 和 Bob 可以相遇的建筑](/solution/2900-2999/2940.Find%20Building%20Where%20Alice%20and%20Bob%20Can%20Meet/README.md) | `栈`,`树状数组`,`线段树`,`数组`,`二分查找`,`单调栈`,`堆(优先队列)` | 困难 | 第 372 场周赛 |
29542954
| 2941 | [Maximum GCD-Sum of a Subarray](/solution/2900-2999/2941.Maximum%20GCD-Sum%20of%20a%20Subarray/README.md) | | 困难 | 🔒 |
29552955

29562956
## 版权

solution/README_EN.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2944,11 +2944,11 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
29442944
| 2933 | [High-Access Employees](/solution/2900-2999/2933.High-Access%20Employees/README_EN.md) | `Array`,`Hash Table`,`String`,`Sorting` | Medium | Weekly Contest 371 |
29452945
| 2934 | [Minimum Operations to Maximize Last Elements in Arrays](/solution/2900-2999/2934.Minimum%20Operations%20to%20Maximize%20Last%20Elements%20in%20Arrays/README_EN.md) | `Greedy`,`Array` | Medium | Weekly Contest 371 |
29462946
| 2935 | [Maximum Strong Pair XOR II](/solution/2900-2999/2935.Maximum%20Strong%20Pair%20XOR%20II/README_EN.md) | `Bit Manipulation`,`Trie`,`Array`,`Hash Table`,`Sliding Window` | Hard | Weekly Contest 371 |
2947-
| 2936 | [Number of Equal Numbers Blocks](/solution/2900-2999/2936.Number%20of%20Equal%20Numbers%20Blocks/README_EN.md) | | Medium | 🔒 |
2948-
| 2937 | [Make Three Strings Equal](/solution/2900-2999/2937.Make%20Three%20Strings%20Equal/README_EN.md) | | Easy | Weekly Contest 372 |
2949-
| 2938 | [Separate Black and White Balls](/solution/2900-2999/2938.Separate%20Black%20and%20White%20Balls/README_EN.md) | | Medium | Weekly Contest 372 |
2950-
| 2939 | [Maximum Xor Product](/solution/2900-2999/2939.Maximum%20Xor%20Product/README_EN.md) | | Medium | Weekly Contest 372 |
2951-
| 2940 | [Find Building Where Alice and Bob Can Meet](/solution/2900-2999/2940.Find%20Building%20Where%20Alice%20and%20Bob%20Can%20Meet/README_EN.md) | | Hard | Weekly Contest 372 |
2947+
| 2936 | [Number of Equal Numbers Blocks](/solution/2900-2999/2936.Number%20of%20Equal%20Numbers%20Blocks/README_EN.md) | `Array`,`Binary Search`,`Divide and Conquer` | Medium | 🔒 |
2948+
| 2937 | [Make Three Strings Equal](/solution/2900-2999/2937.Make%20Three%20Strings%20Equal/README_EN.md) | `String` | Easy | Weekly Contest 372 |
2949+
| 2938 | [Separate Black and White Balls](/solution/2900-2999/2938.Separate%20Black%20and%20White%20Balls/README_EN.md) | `Greedy`,`Two Pointers`,`String` | Medium | Weekly Contest 372 |
2950+
| 2939 | [Maximum Xor Product](/solution/2900-2999/2939.Maximum%20Xor%20Product/README_EN.md) | `Greedy`,`Bit Manipulation`,`Math` | Medium | Weekly Contest 372 |
2951+
| 2940 | [Find Building Where Alice and Bob Can Meet](/solution/2900-2999/2940.Find%20Building%20Where%20Alice%20and%20Bob%20Can%20Meet/README_EN.md) | `Stack`,`Binary Indexed Tree`,`Segment Tree`,`Array`,`Binary Search`,`Monotonic Stack`,`Heap (Priority Queue)` | Hard | Weekly Contest 372 |
29522952
| 2941 | [Maximum GCD-Sum of a Subarray](/solution/2900-2999/2941.Maximum%20GCD-Sum%20of%20a%20Subarray/README_EN.md) | | Hard | 🔒 |
29532953

29542954
## Copyright

solution/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ def run():
360360
if slug:
361361
question_details[slug] = item
362362

363-
for q in spider.get_all_questions(retry=4):
363+
for q in spider.get_all_questions(retry=6):
364364
slug = q["stat"]["question__title_slug"]
365365
qid = q["stat"]["frontend_question_id"]
366366
if slug in question_details:
367367
continue
368368
detail = spider.get_question_detail(
369369
slug, retry=4
370-
) or spider.get_question_detail_en(slug, retry=4)
370+
) or spider.get_question_detail_en(slug, retry=8)
371371
if not detail:
372372
continue
373373
time.sleep(0.3)

0 commit comments

Comments
 (0)