Skip to content

Commit 79aba16

Browse files
yanglbmeidoocs
andauthored
feat: update lc problems (doocs#2421)
Co-authored-by: Doocs Bot <doocs-bot@outlook.com>
1 parent 5011d97 commit 79aba16

File tree

194 files changed

+14294
-13021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+14294
-13021
lines changed

solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给定一个字符串 <code>s</code> ,请你找出其中不含有重复字符的&nbsp;<strong>最长子串&nbsp;</strong>的长度。</p>
11+
<p>给定一个字符串 <code>s</code> ,请你找出其中不含有重复字符的&nbsp;<strong>最长<span data-keyword="substring">子串</span></strong><strong>&nbsp;</strong>的长度。</p>
1212

1313
<p>&nbsp;</p>
1414

solution/0000-0099/0005.Longest Palindromic Substring/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个字符串 <code>s</code>,找到 <code>s</code> 中最长的回文子串。</p>
11+
<p>给你一个字符串 <code>s</code>,找到 <code>s</code> 中最长的回文<span data-keyword="substring">子串</span>。</p>
1212

1313
<p>如果字符串的反序与原始字符串相同,则该字符串称为回文字符串。</p>
1414

solution/0000-0099/0009.Palindrome Number/README.md

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

1111
<p>给你一个整数 <code>x</code> ,如果 <code>x</code> 是一个回文整数,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
1212

13-
<p>回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。</p>
13+
<p><span data-keyword="palindrome-integer">回文数</span>是指正序(从左向右)和倒序(从右向左)读都是一样的整数。</p>
1414

1515
<ul>
1616
<li>例如,<code>121</code> 是回文,而 <code>123</code> 不是。</li>

solution/0000-0099/0023.Merge k Sorted Lists/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ public class Solution {
348348
class ListNode {
349349
public $val;
350350
public $next;
351-
public function __construct($val = 0, $next = null)
352-
{
351+
public function __construct($val = 0, $next = null) {
353352
$this->val = $val;
354353
$this->next = $next;
355354
}

solution/0000-0099/0023.Merge k Sorted Lists/README_EN.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ public class Solution {
347347
class ListNode {
348348
public $val;
349349
public $next;
350-
public function __construct($val = 0, $next = null)
351-
{
350+
public function __construct($val = 0, $next = null) {
352351
$this->val = $val;
353352
$this->next = $next;
354353
}

solution/0000-0099/0032.Longest Valid Parentheses/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个只包含 <code>'('</code> 和 <code>')'</code> 的字符串,找出最长有效(格式正确且连续)括号子串的长度。</p>
11+
<p>给你一个只包含 <code>'('</code>&nbsp;和 <code>')'</code>&nbsp;的字符串,找出最长有效(格式正确且连续)括号<span data-keyword="substring">子串</span>的长度。</p>
1212

13-
<p> </p>
13+
<p>&nbsp;</p>
1414

1515
<div class="original__bRMd">
1616
<div>
@@ -37,12 +37,12 @@
3737
<strong>输出:</strong>0
3838
</pre>
3939

40-
<p> </p>
40+
<p>&nbsp;</p>
4141

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

4444
<ul>
45-
<li><code>0 <= s.length <= 3 * 10<sup>4</sup></code></li>
45+
<li><code>0 &lt;= s.length &lt;= 3 * 10<sup>4</sup></code></li>
4646
<li><code>s[i]</code> 为 <code>'('</code> 或 <code>')'</code></li>
4747
</ul>
4848
</div>

solution/0000-0099/0041.First Missing Positive/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@
1111
<p>给你一个未排序的整数数组 <code>nums</code> ,请你找出其中没有出现的最小的正整数。</p>
1212
请你实现时间复杂度为 <code>O(n)</code> 并且只使用常数级别额外空间的解决方案。
1313

14-
<p> </p>
14+
<p>&nbsp;</p>
1515

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

1818
<pre>
1919
<strong>输入:</strong>nums = [1,2,0]
2020
<strong>输出:</strong>3
21-
</pre>
21+
<strong>解释:</strong>范围 [1,2] 中的数字都在数组中。</pre>
2222

2323
<p><strong>示例 2:</strong></p>
2424

2525
<pre>
2626
<strong>输入:</strong>nums = [3,4,-1,1]
2727
<strong>输出:</strong>2
28-
</pre>
28+
<strong>解释:</strong>1 在数组中,但 2 没有。</pre>
2929

3030
<p><strong>示例 3:</strong></p>
3131

3232
<pre>
3333
<strong>输入:</strong>nums = [7,8,9,11,12]
3434
<strong>输出:</strong>1
35-
</pre>
35+
<strong>解释:</strong>最小的正数 1 没有出现。</pre>
3636

37-
<p> </p>
37+
<p>&nbsp;</p>
3838

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

4141
<ul>
42-
<li><code>1 <= nums.length <= 5 * 10<sup>5</sup></code></li>
43-
<li><code>-2<sup>31</sup> <= nums[i] <= 2<sup>31</sup> - 1</code></li>
42+
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
43+
<li><code>-2<sup>31</sup> &lt;= nums[i] &lt;= 2<sup>31</sup> - 1</code></li>
4444
</ul>
4545

4646
## 解法

solution/0000-0099/0041.First Missing Positive/README_EN.md

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

77
## Description
88

9-
<p>Given an unsorted integer array <code>nums</code>, return the smallest missing positive integer.</p>
9+
<p>Given an unsorted integer array <code>nums</code>. Return the <em>smallest positive integer</em> that is <em>not present</em> in <code>nums</code>.</p>
1010

1111
<p>You must implement an algorithm that runs in <code>O(n)</code> time and uses <code>O(1)</code> auxiliary space.</p>
1212

solution/0000-0099/0053.Maximum Subarray/README.md

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

1111
<p>给你一个整数数组 <code>nums</code> ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。</p>
1212

13-
<p><strong>子数组 </strong>是数组中的一个连续部分。</p>
13+
<p><strong><span data-keyword="subarray-nonempty">子数组 </span></strong>是数组中的一个连续部分。</p>
1414

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

solution/0000-0099/0058.Length of Last Word/README.md

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

1111
<p>给你一个字符串 <code>s</code>,由若干单词组成,单词前后用一些空格字符隔开。返回字符串中 <strong>最后一个</strong> 单词的长度。</p>
1212

13-
<p><strong>单词</strong> 是指仅由字母组成、不包含任何空格字符的最大子字符串。</p>
13+
<p><strong>单词</strong> 是指仅由字母组成、不包含任何空格字符的最大<span data-keyword="substring">子字符串</span>。</p>
1414

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

solution/0000-0099/0078.Subsets/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个整数数组 <code>nums</code> ,数组中的元素 <strong>互不相同</strong> 。返回该数组所有可能的子集(幂集)。</p>
11+
<p>给你一个整数数组&nbsp;<code>nums</code> ,数组中的元素 <strong>互不相同</strong> 。返回该数组所有可能的<span data-keyword="subset">子集</span>(幂集)。</p>
1212

1313
<p>解集 <strong>不能</strong> 包含重复的子集。你可以按 <strong>任意顺序</strong> 返回解集。</p>
1414

15-
<p> </p>
15+
<p>&nbsp;</p>
1616

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

@@ -28,13 +28,13 @@
2828
<strong>输出:</strong>[[],[0]]
2929
</pre>
3030

31-
<p> </p>
31+
<p>&nbsp;</p>
3232

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

3535
<ul>
36-
<li><code>1 <= nums.length <= 10</code></li>
37-
<li><code>-10 <= nums[i] <= 10</code></li>
36+
<li><code>1 &lt;= nums.length &lt;= 10</code></li>
37+
<li><code>-10 &lt;= nums[i] &lt;= 10</code></li>
3838
<li><code>nums</code> 中的所有元素 <strong>互不相同</strong></li>
3939
</ul>
4040

solution/0000-0099/0079.Word Search/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0000-0099/0079.Word%20Search/README_EN.md)
44

5-
<!-- tags:数组,回溯,矩阵 -->
5+
<!-- tags:数组,字符串,回溯,矩阵 -->
66

77
## 题目描述
88

solution/0000-0099/0079.Word Search/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0000-0099/0079.Word%20Search/README.md)
44

5-
<!-- tags:Array,Backtracking,Matrix -->
5+
<!-- tags:Array,String,Backtracking,Matrix -->
66

77
## Description
88

solution/0000-0099/0090.Subsets II/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个整数数组 <code>nums</code> ,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。</p>
11+
<p>给你一个整数数组 <code>nums</code> ,其中可能包含重复元素,请你返回该数组所有可能的&lt;span data-keyword="subset"&gt;子集&lt;/span&gt;(幂集)。</p>
1212

1313
<p>解集 <strong>不能</strong> 包含重复的子集。返回的解集中,子集可以按 <strong>任意顺序</strong> 排列。</p>
1414

1515
<div class="original__bRMd">
1616
<div>
17-
<p> </p>
17+
<p>&nbsp;</p>
1818

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

@@ -30,13 +30,13 @@
3030
<strong>输出:</strong>[[],[0]]
3131
</pre>
3232

33-
<p> </p>
33+
<p>&nbsp;</p>
3434

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

3737
<ul>
38-
<li><code>1 <= nums.length <= 10</code></li>
39-
<li><code>-10 <= nums[i] <= 10</code></li>
38+
<li><code>1 &lt;= nums.length &lt;= 10</code></li>
39+
<li><code>-10 &lt;= nums[i] &lt;= 10</code></li>
4040
</ul>
4141
</div>
4242
</div>

solution/0000-0099/0097.Interleaving String/README.md

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

1111
<p>给定三个字符串&nbsp;<code>s1</code>、<code>s2</code>、<code>s3</code>,请你帮忙验证&nbsp;<code>s3</code>&nbsp;是否是由&nbsp;<code>s1</code>&nbsp;&nbsp;<code>s2</code><em> </em><strong>交错 </strong>组成的。</p>
1212

13-
<p>两个字符串 <code>s</code> 和 <code>t</code> <strong>交错</strong> 的定义与过程如下,其中每个字符串都会被分割成若干 <strong>非空</strong> 子字符串:</p>
13+
<p>两个字符串 <code>s</code> 和 <code>t</code> <strong>交错</strong> 的定义与过程如下,其中每个字符串都会被分割成若干 <strong>非空</strong> <span data-keyword="substring-nonempty">子字符串</span>:</p>
1414

1515
<ul>
1616
<li><code>s = s<sub>1</sub> + s<sub>2</sub> + ... + s<sub>n</sub></code></li>

solution/0000-0099/0098.Validate Binary Search Tree/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<p><strong>有效</strong> 二叉搜索树定义如下:</p>
1414

1515
<ul>
16-
<li>节点的左子树只包含<strong> 小于 </strong>当前节点的数。</li>
16+
<li>节点的左<span data-keyword="subtree">子树</span>只包含<strong> 小于 </strong>当前节点的数。</li>
1717
<li>节点的右子树只包含 <strong>大于</strong> 当前节点的数。</li>
1818
<li>所有左子树和右子树自身必须也是二叉搜索树。</li>
1919
</ul>

solution/0100-0199/0108.Convert Sorted Array to Binary Search Tree/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个整数数组 <code>nums</code> ,其中元素已经按 <strong>升序</strong> 排列,请你将其转换为一棵 <strong>高度平衡</strong> 二叉搜索树。</p>
12-
13-
<p><strong>高度平衡 </strong>二叉树是一棵满足「每个节点的左右两个子树的高度差的绝对值不超过 1 」的二叉树。</p>
11+
<p>给你一个整数数组 <code>nums</code> ,其中元素已经按 <strong>升序</strong> 排列,请你将其转换为一棵 <span data-keyword="height-balanced">平衡</span> 二叉搜索树。</p>
1412

1513
<p>&nbsp;</p>
1614

solution/0100-0199/0109.Convert Sorted List to Binary Search Tree/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给定一个单链表的头节点 &nbsp;<code>head</code>&nbsp;,其中的元素 <strong>按升序排序</strong> ,将其转换为高度平衡的二叉搜索树。</p>
12-
13-
<p>本题中,一个高度平衡二叉树是指一个二叉树<em>每个节点&nbsp;</em>的左右两个子树的高度差不超过 1。</p>
11+
<p>给定一个单链表的头节点 &nbsp;<code>head</code>&nbsp;,其中的元素 <strong>按升序排序</strong> ,将其转换为 <span data-keyword="height-balanced">平衡</span> 二叉搜索树。</p>
1412

1513
<p>&nbsp;</p>
1614

solution/0100-0199/0110.Balanced Binary Tree/README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给定一个二叉树,判断它是否是高度平衡的二叉树。</p>
11+
<p>给定一个二叉树,判断它是否是 <span data-keyword="height-balanced">平衡二叉树</span> &nbsp;</p>
1212

13-
<p>本题中,一棵高度平衡二叉树定义为:</p>
14-
15-
<blockquote>
16-
<p>一个二叉树<em>每个节点 </em>的左右两个子树的高度差的绝对值不超过 1 。</p>
17-
</blockquote>
18-
19-
<p> </p>
13+
<p>&nbsp;</p>
2014

2115
<p><strong>示例 1:</strong></p>
2216
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0100-0199/0110.Balanced%20Binary%20Tree/images/balance_1.jpg" style="width: 342px; height: 221px;" />
@@ -39,13 +33,13 @@
3933
<strong>输出:</strong>true
4034
</pre>
4135

42-
<p> </p>
36+
<p>&nbsp;</p>
4337

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

4640
<ul>
4741
<li>树中的节点数在范围 <code>[0, 5000]</code> 内</li>
48-
<li><code>-10<sup>4</sup> <= Node.val <= 10<sup>4</sup></code></li>
42+
<li><code>-10<sup>4</sup> &lt;= Node.val &lt;= 10<sup>4</sup></code></li>
4943
</ul>
5044

5145
## 解法

solution/0100-0199/0131.Palindrome Partitioning/README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个字符串 <code>s</code>,请你将<em> </em><code>s</code><em> </em>分割成一些子串,使每个子串都是 <strong>回文串</strong> 。返回 <code>s</code> 所有可能的分割方案。</p>
11+
<p>给你一个字符串 <code>s</code>,请你将<em> </em><code>s</code><em> </em>分割成一些子串,使每个子串都是 <strong><span data-keyword="palindrome-string">回文串</span></strong> 。返回 <code>s</code> 所有可能的分割方案。</p>
1212

13-
<p><strong>回文串</strong> 是正着读和反着读都一样的字符串。</p>
14-
15-
<p> </p>
13+
<p>&nbsp;</p>
1614

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

@@ -28,12 +26,12 @@
2826
<strong>输出:</strong>[["a"]]
2927
</pre>
3028

31-
<p> </p>
29+
<p>&nbsp;</p>
3230

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

3533
<ul>
36-
<li><code>1 <= s.length <= 16</code></li>
34+
<li><code>1 &lt;= s.length &lt;= 16</code></li>
3735
<li><code>s</code> 仅由小写英文字母组成</li>
3836
</ul>
3937

solution/0100-0199/0132.Palindrome Partitioning II/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个字符串 <code>s</code>,请你将 <code>s</code> 分割成一些子串,使每个子串都是回文。</p>
11+
<p>给你一个字符串 <code>s</code>,请你将 <code>s</code> 分割成一些子串,使每个子串都是<span data-keyword="palindrome-string">回文串</span>。</p>
1212

1313
<p>返回符合要求的 <strong>最少分割次数</strong> 。</p>
1414

1515
<div class="original__bRMd">
1616
<div>
17-
<p> </p>
17+
<p>&nbsp;</p>
1818

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

2121
<pre>
2222
<strong>输入:</strong>s = "aab"
2323
<strong>输出:</strong>1
24-
<strong>解释:</strong>只需一次分割就可将 <em>s </em>分割成 ["aa","b"] 这样两个回文子串。
24+
<strong>解释:</strong>只需一次分割就可将&nbsp;<em>s </em>分割成 ["aa","b"] 这样两个回文子串。
2525
</pre>
2626

2727
<p><strong>示例 2:</strong></p>
@@ -38,12 +38,12 @@
3838
<strong>输出:</strong>1
3939
</pre>
4040

41-
<p> </p>
41+
<p>&nbsp;</p>
4242

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

4545
<ul>
46-
<li><code>1 <= s.length <= 2000</code></li>
46+
<li><code>1 &lt;= s.length &lt;= 2000</code></li>
4747
<li><code>s</code> 仅由小写英文字母组成</li>
4848
</ul>
4949
</div>

solution/0100-0199/0152.Maximum Product Subarray/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个整数数组 <code>nums</code>&nbsp;请你找出数组中乘积最大的非空连续子数组(该子数组中至少包含一个数字),并返回该子数组所对应的乘积。</p>
11+
<p>给你一个整数数组 <code>nums</code>&nbsp;请你找出数组中乘积最大的非空连续<span data-keyword="subarray-nonempty">子数组</span>(该子数组中至少包含一个数字),并返回该子数组所对应的乘积。</p>
1212

1313
<p>测试用例的答案是一个&nbsp;<strong>32-位</strong> 整数。</p>
1414

15-
<p><strong>子数组</strong> 是数组的连续子序列。</p>
16-
1715
<p>&nbsp;</p>
1816

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

solution/0100-0199/0159.Longest Substring with At Most Two Distinct Characters/README.md

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

99
<!-- 这里写题目描述 -->
1010

11-
给你一个字符串 <code>s</code> ,请你找出&nbsp;<strong>至多&nbsp;</strong>包含 <strong>两个不同字符</strong> 的最长子串,并返回该子串的长度。
11+
给你一个字符串 <code>s</code> ,请你找出&nbsp;<strong>至多&nbsp;</strong>包含 <strong>两个不同字符</strong> 的最长<span data-keyword="substring">子串</span>,并返回该子串的长度。
1212

1313
<p>&nbsp;</p>
1414

0 commit comments

Comments
 (0)