Skip to content

Commit c8d7584

Browse files
committed
feat: update lc problems
1 parent 2e57474 commit c8d7584

File tree

87 files changed

+212
-156
lines changed

Some content is hidden

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

87 files changed

+212
-156
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tags:
2727
<pre>
2828
<strong>输入: </strong>s = "abcabcbb"
2929
<strong>输出: </strong>3
30-
<strong>解释:</strong> 因为无重复字符的最长子串是 <code>"abc"</code>,所以其长度为 3。
30+
<strong>解释:</strong> 因为无重复字符的最长子串是 <code>"abc"</code>,所以其长度为 3。注意 "bca" 和 "cab" 也是正确答案。
3131
</pre>
3232

3333
<p><strong>示例 2:</strong></p>

solution/0000-0099/0017.Letter Combinations of a Phone Number/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ tags:
3535

3636
<p><strong>示例 2:</strong></p>
3737

38-
<pre>
39-
<strong>输入:</strong>digits = ""
40-
<strong>输出:</strong>[]
41-
</pre>
42-
43-
<p><strong>示例 3:</strong></p>
44-
4538
<pre>
4639
<strong>输入:</strong>digits = "2"
4740
<strong>输出:</strong>["a","b","c"]
@@ -52,7 +45,7 @@ tags:
5245
<p><strong>提示:</strong></p>
5346

5447
<ul>
55-
<li><code>0 &lt;= digits.length &lt;= 4</code></li>
48+
<li><code>1 &lt;= digits.length &lt;= 4</code></li>
5649
<li><code>digits[i]</code> 是范围 <code>['2', '9']</code> 的一个数字。</li>
5750
</ul>
5851

solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ tags:
3232

3333
<p><strong class="example">Example 2:</strong></p>
3434

35-
<pre>
36-
<strong>Input:</strong> digits = &quot;&quot;
37-
<strong>Output:</strong> []
38-
</pre>
39-
40-
<p><strong class="example">Example 3:</strong></p>
41-
4235
<pre>
4336
<strong>Input:</strong> digits = &quot;2&quot;
4437
<strong>Output:</strong> [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]
@@ -48,7 +41,7 @@ tags:
4841
<p><strong>Constraints:</strong></p>
4942

5043
<ul>
51-
<li><code>0 &lt;= digits.length &lt;= 4</code></li>
44+
<li><code>1 &lt;= digits.length &lt;= 4</code></li>
5245
<li><code>digits[i]</code> is a digit in the range <code>[&#39;2&#39;, &#39;9&#39;]</code>.</li>
5346
</ul>
5447

solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ tags:
1919

2020
<p>给你一个 <strong>非严格递增排列</strong> 的数组 <code>nums</code> ,请你<strong><a href="http://baike.baidu.com/item/%E5%8E%9F%E5%9C%B0%E7%AE%97%E6%B3%95" target="_blank"> 原地</a></strong> 删除重复出现的元素,使每个元素 <strong>只出现一次</strong> ,返回删除后数组的新长度。元素的 <strong>相对顺序</strong> 应该保持 <strong>一致</strong> 。然后返回 <code>nums</code> 中唯一元素的个数。</p>
2121

22-
<p>考虑 <code>nums</code> 的唯一元素的数量为 <code>k</code> ,你需要做以下事情确保你的题解可以被通过:</p>
22+
<p>考虑 <code>nums</code> 的唯一元素的数量为 <code>k</code>。去重后,返回唯一元素的数量 <code>k</code>。</p>
2323

24-
<ul>
25-
<li>更改数组 <code>nums</code> ,使 <code>nums</code> 的前 <code>k</code> 个元素包含唯一元素,并按照它们最初在 <code>nums</code> 中出现的顺序排列。<code>nums</code>&nbsp;的其余元素与 <code>nums</code> 的大小不重要。</li>
26-
<li>返回 <code>k</code>&nbsp;。</li>
27-
</ul>
24+
<p><code>nums</code> 的前 <code>k</code> 个元素应包含 <strong>排序后</strong> 的唯一数字。下标&nbsp;<code>k - 1</code> 之后的剩余元素可以忽略。</p>
2825

2926
<p><strong>判题标准:</strong></p>
3027

@@ -57,7 +54,7 @@ for (int i = 0; i &lt; k; i++) {
5754

5855
<pre>
5956
<strong>输入:</strong>nums = [0,0,1,1,1,2,2,3,3,4]
60-
<strong>输出:</strong>5, nums = [0,1,2,3,4]
57+
<strong>输出:</strong>5, nums = [0,1,2,3,4,_,_,_,_,_]
6158
<strong>解释:</strong>函数应该返回新的长度 <strong><code>5</code></strong> , 并且原数组 <em>nums </em>的前五个元素被修改为 <strong><code>0</code></strong>, <strong><code>1</code></strong>, <strong><code>2</code></strong>, <strong><code>3</code></strong>, <strong><code>4</code></strong> 。不需要考虑数组中超出新长度后面的元素。
6259
</pre>
6360

@@ -67,8 +64,8 @@ for (int i = 0; i &lt; k; i++) {
6764

6865
<ul>
6966
<li><code>1 &lt;= nums.length &lt;= 3 * 10<sup>4</sup></code></li>
70-
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
71-
<li><code>nums</code> 已按 <strong>非严格递增</strong>&nbsp;排列</li>
67+
<li><code>-10<font size="1">0</font>&nbsp;&lt;= nums[i] &lt;= 10<font size="1">0</font></code></li>
68+
<li><code>nums</code> 已按 <strong>非递减</strong>&nbsp;顺序排列。</li>
7269
</ul>
7370

7471
<!-- description:end -->

solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ tags:
1717

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

20-
<p>Given an integer array <code>nums</code> sorted in <strong>non-decreasing order</strong>, remove the duplicates <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank"><strong>in-place</strong></a> such that each unique element appears only <strong>once</strong>. The <strong>relative order</strong> of the elements should be kept the <strong>same</strong>. Then return <em>the number of unique elements in </em><code>nums</code>.</p>
20+
<p>Given an integer array <code>nums</code> sorted in <strong>non-decreasing order</strong>, remove the duplicates <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank"><strong>in-place</strong></a> such that each unique element appears only <strong>once</strong>. The <strong>relative order</strong> of the elements should be kept the <strong>same</strong>.</p>
2121

22-
<p>Consider the number of unique elements of <code>nums</code> to be <code>k</code>, to get accepted, you need to do the following things:</p>
22+
<p>Consider the number of <em>unique elements</em> in&nbsp;<code>nums</code> to be <code>k<strong>​​​​​​​</strong></code>​​​​​​​. <meta charset="UTF-8" />After removing duplicates, return the number of unique elements&nbsp;<code>k</code>.</p>
2323

24-
<ul>
25-
<li>Change the array <code>nums</code> such that the first <code>k</code> elements of <code>nums</code> contain the unique elements in the order they were present in <code>nums</code> initially. The remaining elements of <code>nums</code> are not important as well as the size of <code>nums</code>.</li>
26-
<li>Return <code>k</code>.</li>
27-
</ul>
24+
<p><meta charset="UTF-8" />The first&nbsp;<code>k</code>&nbsp;elements of&nbsp;<code>nums</code>&nbsp;should contain the unique numbers in <strong>sorted order</strong>. The remaining elements beyond index&nbsp;<code>k - 1</code>&nbsp;can be ignored.</p>
2825

2926
<p><strong>Custom Judge:</strong></p>
3027

solution/0000-0099/0085.Maximal Rectangle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tags:
5353
<ul>
5454
<li><code>rows == matrix.length</code></li>
5555
<li><code>cols == matrix[0].length</code></li>
56-
<li><code>1 &lt;= row, cols &lt;= 200</code></li>
56+
<li><code>1 &lt;= rows, cols &lt;= 200</code></li>
5757
<li><code>matrix[i][j]</code> 为 <code>'0'</code> 或 <code>'1'</code></li>
5858
</ul>
5959

solution/0000-0099/0085.Maximal Rectangle/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tags:
5151
<ul>
5252
<li><code>rows == matrix.length</code></li>
5353
<li><code>cols == matrix[i].length</code></li>
54-
<li><code>1 &lt;= row, cols &lt;= 200</code></li>
54+
<li><code>1 &lt;= rows, cols &lt;= 200</code></li>
5555
<li><code>matrix[i][j]</code> is <code>&#39;0&#39;</code> or <code>&#39;1&#39;</code>.</li>
5656
</ul>
5757

solution/0100-0199/0118.Pascal's Triangle/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ tags:
1717

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

20-
<p>给定一个非负整数 <em><code>numRows</code>,</em>生成「杨辉三角」的前 <em><code>numRows</code> </em>行。</p>
20+
<p>给定一个非负整数&nbsp;<em><code>numRows</code>,</em>生成「杨辉三角」的前&nbsp;<em><code>numRows</code>&nbsp;</em>行。</p>
2121

22-
<p><small>在「杨辉三角」中,每个数是它左上方和右上方的数的和。</small></p>
22+
<p>在<strong>「杨辉三角」</strong>中,每个数是它左上方和右上方的数的和。</p>
2323

2424
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0100-0199/0118.Pascal%27s%20Triangle/images/1626927345-DZmfxB-PascalTriangleAnimated2.gif" /></p>
2525

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

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

@@ -32,19 +32,19 @@ tags:
3232
<strong>输出:</strong> [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
3333
</pre>
3434

35-
<p><strong>示例 2:</strong></p>
35+
<p><strong>示例&nbsp;2:</strong></p>
3636

3737
<pre>
3838
<strong>输入:</strong> numRows = 1
3939
<strong>输出:</strong> [[1]]
4040
</pre>
4141

42-
<p> </p>
42+
<p>&nbsp;</p>
4343

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

4646
<ul>
47-
<li><code>1 <= numRows <= 30</code></li>
47+
<li><code>1 &lt;= numRows &lt;= 30</code></li>
4848
</ul>
4949

5050
<!-- description:end -->

solution/0100-0199/0122.Best Time to Buy and Sell Stock II/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tags:
2020

2121
<p>You are given an integer array <code>prices</code> where <code>prices[i]</code> is the price of a given stock on the <code>i<sup>th</sup></code> day.</p>
2222

23-
<p>On each day, you may decide to buy and/or sell the stock. You can only hold <strong>at most one</strong> share of the stock at any time. However, you can sell and buy the stock multiple times on the <strong>same day</strong>, ensuring you never hold than one share of the stock.</p>
23+
<p>On each day, you may decide to buy and/or sell the stock. You can only hold <strong>at most one</strong> share of the stock at any time. However, you can sell and buy the stock multiple times on the <strong>same day</strong>, ensuring you never hold more than one share of the stock.</p>
2424

2525
<p>Find and return <em>the <strong>maximum</strong> profit you can achieve</em>.</p>
2626

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ tags:
2121

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

24+
<p><strong>请注意</strong>,一个只包含一个元素的数组的乘积是这个元素的值。</p>
25+
2426
<p>&nbsp;</p>
2527

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

0 commit comments

Comments
 (0)