Skip to content

Commit 35120d3

Browse files
committed
docs: update
1 parent 6b8f5fa commit 35120d3

File tree

13 files changed

+68
-49
lines changed

13 files changed

+68
-49
lines changed

solution/0500-0599/0557.Reverse Words in a String III/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<p><strong>示例 2:</strong></p>
2121

2222
<pre>
23-
<strong>输入:</strong> s = "God Ding"
24-
<strong>输出:</strong>"doG gniD"
23+
<strong>输入:</strong> s = "Mr Ding"
24+
<strong>输出:</strong>"rM gniD"
2525
</pre>
2626

2727
<p>&nbsp;</p>

solution/0500-0599/0557.Reverse Words in a String III/README_EN.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88

99
<p>&nbsp;</p>
1010
<p><strong class="example">Example 1:</strong></p>
11-
<pre><strong>Input:</strong> s = "Let's take LeetCode contest"
12-
<strong>Output:</strong> "s'teL ekat edoCteeL tsetnoc"
13-
</pre><p><strong class="example">Example 2:</strong></p>
14-
<pre><strong>Input:</strong> s = "God Ding"
15-
<strong>Output:</strong> "doG gniD"
11+
12+
<pre>
13+
<strong>Input:</strong> s = &quot;Let&#39;s take LeetCode contest&quot;
14+
<strong>Output:</strong> &quot;s&#39;teL ekat edoCteeL tsetnoc&quot;
1615
</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre>
20+
<strong>Input:</strong> s = &quot;Mr Ding&quot;
21+
<strong>Output:</strong> &quot;rM gniD&quot;
22+
</pre>
23+
1724
<p>&nbsp;</p>
1825
<p><strong>Constraints:</strong></p>
1926

solution/1000-1099/1084.Sales Analysis III/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ Product table:
7676
| 1 | S8 |
7777
+-------------+--------------+
7878
<strong>解释:</strong>
79-
id为1的产品仅在2019年春季销售
80-
id为2的产品在2019年春季销售,但也在2019年春季之后销售
81-
id 3的产品在2019年春季之后销售
82-
我们只退回产品1,因为它是2019年春季才销售的产品。</pre>
79+
id 为 1 的产品仅在 2019 年春季销售
80+
id 为 2 的产品在 2019 年春季销售,但也在 2019 年春季之后销售
81+
id 为 3 的产品在 2019 年春季之后销售
82+
我们只返回 id 为 1 的产品,因为它是 2019 年春季才销售的产品。</pre>
8383

8484
## 解法
8585

solution/1500-1599/1522.Diameter of N-Ary Tree/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

9-
<p>给定一棵 N 叉树的根节点&nbsp;<code>root</code>&nbsp;,计算这棵树的直径长度。</p>
9+
<p>给定一棵 <code>N 叉树</code> 的根节点&nbsp;<code>root</code>&nbsp;,计算这棵树的直径长度。</p>
1010

1111
<p>N 叉树的直径指的是树中任意两个节点间路径中<strong> 最长 </strong>路径的长度。这条路径可能经过根节点,也可能不经过根节点。</p>
1212

solution/1500-1599/1522.Diameter of N-Ary Tree/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>Given a <code>root</code> of an <a href="https://leetcode.com/articles/introduction-to-n-ary-trees/" target="_blank">N-ary tree</a>, you need to compute the length of the diameter of the tree.</p>
7+
<p>Given a <code>root</code> of an <code>N-ary tree</code>, you need to compute the length of the diameter of the tree.</p>
88

99
<p>The diameter of an N-ary tree is the length of the <strong>longest</strong> path between any two nodes in the tree. This path may or may not pass through the root.</p>
1010

solution/2400-2499/2431.Maximize Total Tastiness of Purchased Fruits/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<p><strong>注意:</strong></p>
2727

2828
<ul>
29-
<li>每种水果最多只能购买一次。</li>
30-
<li>一些水果你最多只能用一次折价券。</li>
29+
<li>每个水果最多只能购买一次。</li>
30+
<li>一个水果你最多只能用一次折价券。</li>
3131
</ul>
3232

3333
<p>&nbsp;</p>

solution/2400-2499/2436.Minimum Split Into Subarrays With GCD Greater Than One/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给定一个由正整数组成的数组 <code>nums</code>。</p>
1010

11-
<p>将数组拆分为&nbsp;<strong>一个或多个&nbsp;</strong>不相连的子数组,如下所示:</p>
11+
<p>将数组拆分为&nbsp;<strong>一个或多个&nbsp;</strong>互相不覆盖的子数组,如下所示:</p>
1212

1313
<ul>
1414
<li>数组中的每个元素都&nbsp;<strong>只属于一个&nbsp;</strong>子数组,并且</li>

solution/2600-2699/2661.First Completely Painted Row or Column/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<p>从下标 <code>0</code> 开始遍历 <code>arr</code> 中的每个下标 <code>i</code> ,并将包含整数 <code>arr[i]</code> 的 <code>mat</code> 单元格涂色。</p>
1212

13-
<p>请你找出 <code>arr</code> 中在 <code>mat</code> 的某一行或某一列上都被涂色且下标最小的元素,并返回其下标 <code>i</code> 。</p>
13+
<p>请你找出 <code>arr</code> 中第一个使得&nbsp;<code>mat</code> 的某一行或某一列都被涂色的元素,并返回其下标 <code>i</code> 。</p>
1414

1515
<p>&nbsp;</p>
1616

solution/2700-2799/2715.Timeout Cancellation/README_EN.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,66 @@
66

77
<p>Given a function <code>fn</code>, an array of&nbsp;arguments&nbsp;<code>args</code>, and a timeout&nbsp;<code>t</code>&nbsp;in milliseconds, return a cancel function <code>cancelFn</code>.</p>
88

9-
<p>After a delay of&nbsp;<code>t</code>,&nbsp;<code>fn</code>&nbsp;should be called with <code>args</code> passed as parameters <strong>unless</strong> <code>cancelFn</code> was invoked before the delay of <code>t</code> milliseconds elapses, specifically at <code>cancelT</code>&nbsp;ms.&nbsp;In that case,&nbsp;<code>fn</code> should never be called.</p>
9+
<p>After a delay of <code>cancelT</code>, the returned cancel function <code>cancelFn</code> will be invoked.</p>
10+
11+
<pre>
12+
setTimeout(cancelFn, cancelT)
13+
</pre>
14+
15+
<p>Initially, the execution of the function <code>fn</code> should be delayed by <code>t</code> milliseconds.</p>
16+
17+
<p>If, before the delay of <code>t</code> milliseconds, the function <code>cancelFn</code> is invoked, it should cancel the delayed execution of <code>fn</code>. Otherwise, if <code>cancelFn</code> is not invoked within the specified delay <code>t</code>, <code>fn</code> should be executed with the provided <code>args</code> as arguments.</p>
1018

1119
<p>&nbsp;</p>
1220
<p><strong class="example">Example 1:</strong></p>
1321

1422
<pre>
15-
<strong>Input:</strong> fn = (x) =&gt; x * 5, args = [2], t = 20, cancelT = 50
23+
<strong>Input:</strong> fn = (x) =&gt; x * 5, args = [2], t = 20
1624
<strong>Output:</strong> [{&quot;time&quot;: 20, &quot;returned&quot;: 10}]
1725
<strong>Explanation:</strong>
18-
const result = []
26+
const cancelT = 50;
27+
const result = [];
1928

20-
const fn = (x) =&gt; x * 5
29+
const fn = (x) =&gt; x * 5;
2130

22-
const start = performance.now()&nbsp;
31+
const start = performance.now();
2332

2433
const log = (...argsArr) =&gt; {
2534
const diff = Math.floor(performance.now() - start);
26-
result.push({&quot;time&quot;: diff, &quot;returned&quot;: fn(...argsArr)})
35+
result.push({&quot;time&quot;: diff, &quot;returned&quot;: fn(...argsArr)});
2736
}
2837
&nbsp; &nbsp;&nbsp;
2938
const cancel = cancellable(log, [2], 20);
3039

31-
const maxT = Math.max(t, 50)
40+
const maxT = Math.max(t, 50);
3241
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
33-
setTimeout(cancel, cancelT)
42+
setTimeout(cancel, cancelT);
3443

3544
setTimeout(() =&gt; {
36-
&nbsp; &nbsp; console.log(result) // [{&quot;time&quot;:20,&quot;returned&quot;:10}]
37-
}, 65)
45+
&nbsp; &nbsp; console.log(result); // [{&quot;time&quot;:20,&quot;returned&quot;:10}]
46+
}, 65);
3847

3948
The cancellation was scheduled to occur after a delay of cancelT (50ms), which happened after the execution of fn(2) at 20ms.
4049
</pre>
4150

4251
<p><strong class="example">Example 2:</strong></p>
4352

4453
<pre>
45-
<strong>Input:</strong> fn = (x) =&gt; x**2, args = [2], t = 100, cancelT = 50
54+
<strong>Input:</strong> fn = (x) =&gt; x**2, args = [2], t = 100
4655
<strong>Output:</strong> []
47-
<strong>Explanation:</strong> The cancellation was scheduled to occur after a delay of cancelT (50ms), which happened before the execution of fn(2) at 100ms, resulting in fn(2) never being called.
56+
<strong>Explanation:</strong>
57+
const cancelT = 50;
58+
The cancellation was scheduled to occur after a delay of cancelT (50ms), which happened before the execution of fn(2) at 100ms, resulting in fn(2) never being called.
4859
</pre>
4960

5061
<p><strong class="example">Example 3:</strong></p>
5162

5263
<pre>
53-
<strong>Input:</strong> fn = (x1, x2) =&gt; x1 * x2, args = [2,4], t = 30, cancelT = 100
64+
<strong>Input:</strong> fn = (x1, x2) =&gt; x1 * x2, args = [2,4], t = 30
5465
<strong>Output:</strong> [{&quot;time&quot;: 30, &quot;returned&quot;: 8}]
55-
<strong>Explanation: </strong>The cancellation was scheduled to occur after a delay of cancelT (100ms), which happened after the execution of fn(2,4) at 30ms.
66+
<strong>Explanation:
67+
</strong>const cancelT = 100;
68+
The cancellation was scheduled to occur after a delay of cancelT (100ms), which happened after the execution of fn(2,4) at 30ms.
5669
</pre>
5770

5871
<p>&nbsp;</p>

solution/2900-2999/2948.Make Lexicographically Smallest Array by Swapping Elements/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<p>返回执行任意次操作后能得到的 <strong>字典序最小的数组</strong><em> </em>。</p>
1414

15-
<p>如果在数组 <code>a</code> 和数组 <code>b</code> 第一个不同的位置上,数组 <code>a</code> 中的对应字符比数组 <code>b</code> 中的对应字符的字典序更小,则认为数组 <code>a</code> 就比数组 <code>b</code> 字典序更小。例如,数组 <code>[2,10,3]</code> 比数组 <code>[10,2,3]</code> 字典序更小,下标 <code>0</code> 处是两个数组第一个不同的位置,且 <code>2 &lt; 10</code> 。</p>
15+
<p>如果在数组 <code>a</code> 和数组 <code>b</code> 第一个不同的位置上,数组 <code>a</code> 中的对应元素比数组 <code>b</code> 中的对应元素的字典序更小,则认为数组 <code>a</code> 就比数组 <code>b</code> 字典序更小。例如,数组 <code>[2,10,3]</code> 比数组 <code>[10,2,3]</code> 字典序更小,下标 <code>0</code> 处是两个数组第一个不同的位置,且 <code>2 &lt; 10</code> 。</p>
1616

1717
<p>&nbsp;</p>
1818

solution/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@
12941294
| 1281 | [整数的各位积和之差](/solution/1200-1299/1281.Subtract%20the%20Product%20and%20Sum%20of%20Digits%20of%20an%20Integer/README.md) | `数学` | 简单 | 第 166 场周赛 |
12951295
| 1282 | [用户分组](/solution/1200-1299/1282.Group%20the%20People%20Given%20the%20Group%20Size%20They%20Belong%20To/README.md) | `数组`,`哈希表` | 中等 | 第 166 场周赛 |
12961296
| 1283 | [使结果不超过阈值的最小除数](/solution/1200-1299/1283.Find%20the%20Smallest%20Divisor%20Given%20a%20Threshold/README.md) | `数组`,`二分查找` | 中等 | 第 166 场周赛 |
1297-
| 1284 | [转化为全零矩阵的最少反转次数](/solution/1200-1299/1284.Minimum%20Number%20of%20Flips%20to%20Convert%20Binary%20Matrix%20to%20Zero%20Matrix/README.md) | `位运算`,`广度优先搜索`,`数组`,`矩阵` | 困难 | 第 166 场周赛 |
1297+
| 1284 | [转化为全零矩阵的最少反转次数](/solution/1200-1299/1284.Minimum%20Number%20of%20Flips%20to%20Convert%20Binary%20Matrix%20to%20Zero%20Matrix/README.md) | `位运算`,`广度优先搜索`,`数组`,`哈希表`,`矩阵` | 困难 | 第 166 场周赛 |
12981298
| 1285 | [找到连续区间的开始和结束数字](/solution/1200-1299/1285.Find%20the%20Start%20and%20End%20Number%20of%20Continuous%20Ranges/README.md) | `数据库` | 中等 | 🔒 |
12991299
| 1286 | [字母组合迭代器](/solution/1200-1299/1286.Iterator%20for%20Combination/README.md) | `设计`,`字符串`,`回溯`,`迭代器` | 中等 | 第 15 场双周赛 |
13001300
| 1287 | [有序数组中出现次数超过25%的元素](/solution/1200-1299/1287.Element%20Appearing%20More%20Than%2025%25%20In%20Sorted%20Array/README.md) | `数组` | 简单 | 第 15 场双周赛 |
@@ -1895,7 +1895,7 @@
18951895
| 1882 | [使用服务器处理任务](/solution/1800-1899/1882.Process%20Tasks%20Using%20Servers/README.md) | `数组`,`堆(优先队列)` | 中等 | 第 243 场周赛 |
18961896
| 1883 | [准时抵达会议现场的最小跳过休息次数](/solution/1800-1899/1883.Minimum%20Skips%20to%20Arrive%20at%20Meeting%20On%20Time/README.md) | `数组`,`动态规划` | 困难 | 第 243 场周赛 |
18971897
| 1884 | [鸡蛋掉落-两枚鸡蛋](/solution/1800-1899/1884.Egg%20Drop%20With%202%20Eggs%20and%20N%20Floors/README.md) | `数学`,`动态规划` | 中等 | |
1898-
| 1885 | [统计数对](/solution/1800-1899/1885.Count%20Pairs%20in%20Two%20Arrays/README.md) | `数组`,`二分查找`,`排序` | 中等 | 🔒 |
1898+
| 1885 | [统计数对](/solution/1800-1899/1885.Count%20Pairs%20in%20Two%20Arrays/README.md) | `数组`,`双指针`,`二分查找`,`排序` | 中等 | 🔒 |
18991899
| 1886 | [判断矩阵经轮转后是否一致](/solution/1800-1899/1886.Determine%20Whether%20Matrix%20Can%20Be%20Obtained%20By%20Rotation/README.md) | `数组`,`矩阵` | 简单 | 第 244 场周赛 |
19001900
| 1887 | [使数组元素相等的减少操作次数](/solution/1800-1899/1887.Reduction%20Operations%20to%20Make%20the%20Array%20Elements%20Equal/README.md) | `数组`,`排序` | 中等 | 第 244 场周赛 |
19011901
| 1888 | [使二进制字符串字符交替的最少反转次数](/solution/1800-1899/1888.Minimum%20Number%20of%20Flips%20to%20Make%20the%20Binary%20String%20Alternating/README.md) | `贪心`,`字符串`,`动态规划`,`滑动窗口` | 中等 | 第 244 场周赛 |
@@ -2593,7 +2593,7 @@
25932593
| 2580 | [统计将重叠区间合并成组的方案数](/solution/2500-2599/2580.Count%20Ways%20to%20Group%20Overlapping%20Ranges/README.md) | `数组`,`排序` | 中等 | 第 99 场双周赛 |
25942594
| 2581 | [统计可能的树根数目](/solution/2500-2599/2581.Count%20Number%20of%20Possible%20Root%20Nodes/README.md) | `树`,`深度优先搜索`,`哈希表`,`动态规划` | 困难 | 第 99 场双周赛 |
25952595
| 2582 | [递枕头](/solution/2500-2599/2582.Pass%20the%20Pillow/README.md) | `数学`,`模拟` | 简单 | 第 335 场周赛 |
2596-
| 2583 | [二叉树中的第 K 大层和](/solution/2500-2599/2583.Kth%20Largest%20Sum%20in%20a%20Binary%20Tree/README.md) | `树`,`广度优先搜索`,`二分查找` | 中等 | 第 335 场周赛 |
2596+
| 2583 | [二叉树中的第 K 大层和](/solution/2500-2599/2583.Kth%20Largest%20Sum%20in%20a%20Binary%20Tree/README.md) | `树`,`广度优先搜索`,`二叉树`,`排序` | 中等 | 第 335 场周赛 |
25972597
| 2584 | [分割数组使乘积互质](/solution/2500-2599/2584.Split%20the%20Array%20to%20Make%20Coprime%20Products/README.md) | `数组`,`哈希表`,`数学`,`数论` | 困难 | 第 335 场周赛 |
25982598
| 2585 | [获得分数的方法数](/solution/2500-2599/2585.Number%20of%20Ways%20to%20Earn%20Points/README.md) | `数组`,`动态规划` | 困难 | 第 335 场周赛 |
25992599
| 2586 | [统计范围内的元音字符串数](/solution/2500-2599/2586.Count%20the%20Number%20of%20Vowel%20Strings%20in%20Range/README.md) | `数组`,`字符串` | 简单 | 第 336 场周赛 |
@@ -2960,11 +2960,11 @@
29602960
| 2947 | [统计美丽子字符串 I](/solution/2900-2999/2947.Count%20Beautiful%20Substrings%20I/README.md) | `字符串`,`枚举`,`前缀和` | 中等 | 第 373 场周赛 |
29612961
| 2948 | [交换得到字典序最小的数组](/solution/2900-2999/2948.Make%20Lexicographically%20Smallest%20Array%20by%20Swapping%20Elements/README.md) | `并查集`,`数组`,`排序` | 中等 | 第 373 场周赛 |
29622962
| 2949 | [统计美丽子字符串 II](/solution/2900-2999/2949.Count%20Beautiful%20Substrings%20II/README.md) | `哈希表`,`数学`,`字符串`,`数论`,`前缀和` | 困难 | 第 373 场周赛 |
2963-
| 2950 | [可整除子串的数量](/solution/2900-2999/2950.Number%20of%20Divisible%20Substrings/README.md) | | 中等 | 🔒 |
2964-
| 2951 | [找出峰值](/solution/2900-2999/2951.Find%20the%20Peaks/README.md) | | 简单 | 第 374 场周赛 |
2965-
| 2952 | [需要添加的硬币的最小数量](/solution/2900-2999/2952.Minimum%20Number%20of%20Coins%20to%20be%20Added/README.md) | | 中等 | 第 374 场周赛 |
2966-
| 2953 | [统计完全子字符串](/solution/2900-2999/2953.Count%20Complete%20Substrings/README.md) | | 中等 | 第 374 场周赛 |
2967-
| 2954 | [统计感冒序列的数目](/solution/2900-2999/2954.Count%20the%20Number%20of%20Infection%20Sequences/README.md) | | 困难 | 第 374 场周赛 |
2963+
| 2950 | [可整除子串的数量](/solution/2900-2999/2950.Number%20of%20Divisible%20Substrings/README.md) | `哈希表`,`字符串`,`计数` | 中等 | 🔒 |
2964+
| 2951 | [找出峰值](/solution/2900-2999/2951.Find%20the%20Peaks/README.md) | `数组`,`枚举` | 简单 | 第 374 场周赛 |
2965+
| 2952 | [需要添加的硬币的最小数量](/solution/2900-2999/2952.Minimum%20Number%20of%20Coins%20to%20be%20Added/README.md) | `贪心`,`数组`,`排序` | 困难 | 第 374 场周赛 |
2966+
| 2953 | [统计完全子字符串](/solution/2900-2999/2953.Count%20Complete%20Substrings/README.md) | `哈希表`,`字符串`,`滑动窗口` | 中等 | 第 374 场周赛 |
2967+
| 2954 | [统计感冒序列的数目](/solution/2900-2999/2954.Count%20the%20Number%20of%20Infection%20Sequences/README.md) | `数组`,`数学`,`组合数学` | 困难 | 第 374 场周赛 |
29682968
| 2955 | [Number of Same-End Substrings](/solution/2900-2999/2955.Number%20of%20Same-End%20Substrings/README.md) | | 中等 | 🔒 |
29692969

29702970
## 版权

0 commit comments

Comments
 (0)