Skip to content

Commit 651e3ea

Browse files
authored
feat: update lc problems (#3646)
1 parent b23860a commit 651e3ea

File tree

9 files changed

+19
-16
lines changed
  • solution
    • 0000-0099/0066.Plus One
    • 0400-0499
    • 1200-1299/1233.Remove Sub-Folders from the Filesystem
    • 2100-2199/2102.Sequentially Ordinal Rank Tracker
    • 3000-3099/3095.Shortest Subarray With OR at Least K I
    • 3300-3399
      • 3319.K-th Largest Perfect Subtree Size in Binary Tree
      • 3323.Minimize Connected Groups by Inserting Interval

9 files changed

+19
-16
lines changed

solution/0000-0099/0066.Plus One/README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ tags:
2323

2424
<p>你可以假设除了整数 0 之外,这个整数不会以零开头。</p>
2525

26-
<p> </p>
26+
<p>&nbsp;</p>
2727

28-
<p><strong>示例 1:</strong></p>
28+
<p><strong>示例&nbsp;1:</strong></p>
2929

3030
<pre>
3131
<strong>输入:</strong>digits = [1,2,3]
3232
<strong>输出:</strong>[1,2,4]
3333
<strong>解释:</strong>输入数组表示数字 123。
3434
</pre>
3535

36-
<p><strong>示例 2:</strong></p>
36+
<p><strong>示例&nbsp;2:</strong></p>
3737

3838
<pre>
3939
<strong>输入:</strong>digits = [4,3,2,1]
@@ -44,17 +44,20 @@ tags:
4444
<p><strong>示例 3:</strong></p>
4545

4646
<pre>
47-
<strong>输入:</strong>digits = [0]
48-
<strong>输出:</strong>[1]
47+
<strong>输入:</strong>digits = [9]
48+
<strong>输出:</strong>[1,0]
49+
<strong>解释:</strong>输入数组表示数字 9。
50+
加 1 得到了 9 + 1 = 10。
51+
因此,结果应该是 [1,0]。
4952
</pre>
5053

51-
<p> </p>
54+
<p>&nbsp;</p>
5255

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

5558
<ul>
56-
<li><code>1 <= digits.length <= 100</code></li>
57-
<li><code>0 <= digits[i] <= 9</code></li>
59+
<li><code>1 &lt;= digits.length &lt;= 100</code></li>
60+
<li><code>0 &lt;= digits[i] &lt;= 9</code></li>
5861
</ul>
5962

6063
<!-- description:end -->

solution/0400-0499/0442.Find All Duplicates in an Array/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tags:
1717

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

20-
<p>给你一个长度为 <code>n</code> 的整数数组 <code>nums</code> ,其中 <code>nums</code> 的所有整数都在范围 <code>[1, n]</code> 内,且每个整数出现 <strong>一次</strong><strong>两次</strong> 。请你找出所有出现 <strong>两次</strong> 的整数,并以数组形式返回。</p>
20+
<p>给你一个长度为 <code>n</code> 的整数数组 <code>nums</code> ,其中 <code>nums</code> 的所有整数都在范围 <code>[1, n]</code> 内,且每个整数出现 <strong>最多</strong><strong>两次</strong> 。请你找出所有出现 <strong>两次</strong> 的整数,并以数组形式返回。</p>
2121

2222
<p>你必须设计并实现一个时间复杂度为 <code>O(n)</code> 且仅使用常量额外空间(不包括存储输出所需的空间)的算法解决此问题。</p>
2323

solution/0400-0499/0480.Sliding Window Median/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tags:
3636
<pre>
3737
<strong>Input:</strong> nums = [1,3,-1,-3,5,3,6,7], k = 3
3838
<strong>Output:</strong> [1.00000,-1.00000,-1.00000,3.00000,5.00000,6.00000]
39-
<strong>Explanation:</strong>
39+
<strong>Explanation:</strong>
4040
Window position Median
4141
--------------- -----
4242
[<strong>1 3 -1</strong>] -3 5 3 6 7 1

solution/1200-1299/1233.Remove Sub-Folders from the Filesystem/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tags:
2323

2424
<p>你是一位系统管理员,手里有一份文件夹列表 <code>folder</code>,你的任务是要删除该列表中的所有 <strong>子文件夹</strong>,并以 <strong>任意顺序</strong> 返回剩下的文件夹。</p>
2525

26-
<p>如果文件夹&nbsp;<code>folder[i]</code>&nbsp;位于另一个文件夹&nbsp;<code>folder[j]</code>&nbsp;下,那么&nbsp;<code>folder[i]</code>&nbsp;就是&nbsp;<code>folder[j]</code>&nbsp;的 <strong>子文件夹</strong> 。</p>
26+
<p>如果文件夹&nbsp;<code>folder[i]</code>&nbsp;位于另一个文件夹&nbsp;<code>folder[j]</code>&nbsp;下,那么&nbsp;<code>folder[i]</code>&nbsp;就是&nbsp;<code>folder[j]</code>&nbsp;的 <strong>子文件夹</strong> 。<code>folder[j]</code>&nbsp;的子文件夹必须以&nbsp;<code>folder[j]</code> 开头,后跟一个 <code>"/"</code>。例如,<code>"/a/b"</code> 是&nbsp;<code>"/a"</code>&nbsp;的一个子文件夹,但&nbsp;<code>"/b"</code> 不是&nbsp;<code>"/a/b/c"</code> 的一个子文件夹。</p>
2727

2828
<p>文件夹的「路径」是由一个或多个按以下格式串联形成的字符串:<font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.6px"><span style="background-color:#f9f2f4">'/'</span></span></font></font>&nbsp;后跟一个或者多个小写英文字母。</p>
2929

solution/1200-1299/1233.Remove Sub-Folders from the Filesystem/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tags:
2323

2424
<p>Given a list of folders <code>folder</code>, return <em>the folders after removing all <strong>sub-folders</strong> in those folders</em>. You may return the answer in <strong>any order</strong>.</p>
2525

26-
<p>If a <code>folder[i]</code> is located within another <code>folder[j]</code>, it is called a <strong>sub-folder</strong> of it.</p>
26+
<p>If a <code>folder[i]</code> is located within another <code>folder[j]</code>, it is called a <strong>sub-folder</strong> of it. A sub-folder of <code>folder[j]</code> must start with <code>folder[j]</code>, followed by a <code>&quot;/&quot;</code>. For example, <code>&quot;/a/b&quot;</code> is a sub-folder of <code>&quot;/a&quot;</code>, but <code>&quot;/b&quot;</code> is not a sub-folder of <code>&quot;/a/b/c&quot;</code>.</p>
2727

2828
<p>The format of a path is one or more concatenated strings of the form: <code>&#39;/&#39;</code> followed by one or more lowercase English letters.</p>
2929

solution/2100-2199/2102.Sequentially Ordinal Rank Tracker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ tags:
5959
SORTracker tracker = new SORTracker(); // 初始化系统
6060
tracker.add("bradford", 2); // 添加 name="bradford" 且 score=2 的景点。
6161
tracker.add("branford", 3); // 添加 name="branford" 且 score=3 的景点。
62-
tracker.get(); // 从好带坏的景点为:branford ,bradford 。
62+
tracker.get(); // 从好到坏的景点为:branford ,bradford 。
6363
// 注意到 branford 比 bradford 好,因为它的 <strong>评分更高</strong> (3 &gt; 2) 。
6464
// 这是第 1 次调用 get() ,所以返回最好的景点:"branford" 。
6565
tracker.add("alps", 2); // 添加 name="alps" 且 score=2 的景点。

solution/3000-3099/3095.Shortest Subarray With OR at Least K I/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ tags:
3838
<p><strong>解释:</strong></p>
3939

4040
<p>子数组&nbsp;<code>[3]</code>&nbsp;的按位&nbsp;<code>OR</code> 值为&nbsp;<code>3</code>&nbsp;,所以我们返回 <code>1</code>&nbsp;。</p>
41+
42+
<p>注意,<code>[2]</code> 也是一个特别子数组。</p>
4143
</div>
4244

4345
<p><strong class="example">示例 2:</strong></p>

solution/3300-3399/3319.K-th Largest Perfect Subtree Size in Binary Tree/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ tags:
2525

2626
<p><strong>完美二叉树 </strong>是指所有叶子节点都在同一层级的树,且每个父节点恰有两个子节点。</p>
2727

28-
<p><strong>子树 </strong>是指树中的某一个节点及其所有后代形成的树。</p>
29-
3028
<p>&nbsp;</p>
3129

3230
<p><strong class="example">示例 1:</strong></p>

solution/3300-3399/3323.Minimize Connected Groups by Inserting Interval/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3323.Mi
3030
<li>然而,区间组&nbsp;<code>[[1, 2], [3, 4]]</code>&nbsp;不是连通的,因为&nbsp;<code>(2, 3)</code>&nbsp;段没有被覆盖。</li>
3131
</ul>
3232

33-
<p>返回在添加&nbsp;<strong>恰好一个</strong>&nbsp;新区间到数组后连通组的 <strong>最小</strong>&nbsp;数量。</p>
33+
<p>返回在数组添加 <strong>恰好一个</strong> 新区间后,连通组的 <strong>最小</strong> 数量。</p>
3434

3535
<p>&nbsp;</p>
3636

0 commit comments

Comments
 (0)