Skip to content

Commit 65effac

Browse files
authored
feat: update lc problems (#4846)
1 parent 4d0817e commit 65effac

File tree

66 files changed

+220
-113
lines changed

Some content is hidden

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

66 files changed

+220
-113
lines changed

solution/0000-0099/0033.Search in Rotated Sorted Array/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ tags:
3030
<p><strong>示例 1:</strong></p>
3131

3232
<pre>
33-
<strong>输入:</strong>nums = [<code>4,5,6,7,0,1,2]</code>, target = 0
33+
<strong>输入:</strong>nums = [4,5,6,7,0,1,2], target = 0
3434
<strong>输出:</strong>4
3535
</pre>
3636

3737
<p><strong>示例&nbsp;2:</strong></p>
3838

3939
<pre>
40-
<strong>输入:</strong>nums = [<code>4,5,6,7,0,1,2]</code>, target = 3
40+
<strong>输入:</strong>nums = [4,5,6,7,0,1,2], target = 3
4141
<strong>输出:</strong>-1</pre>
4242

4343
<p><strong>示例 3:</strong></p>

solution/0100-0199/0169.Majority Element/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ tags:
4646
<li><code>n == nums.length</code></li>
4747
<li><code>1 &lt;= n &lt;= 5 * 10<sup>4</sup></code></li>
4848
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
49+
<li>输入保证数组中一定有一个多数元素。</li>
4950
</ul>
5051

5152
<p>&nbsp;</p>

solution/0100-0199/0169.Majority Element/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tags:
3939
<li><code>n == nums.length</code></li>
4040
<li><code>1 &lt;= n &lt;= 5 * 10<sup>4</sup></code></li>
4141
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
42+
<li>The input is generated such that a majority element will exist in the array.</li>
4243
</ul>
4344

4445
<p>&nbsp;</p>

solution/0200-0299/0224.Basic Calculator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ tags:
5454
<li><code>1 &lt;= s.length &lt;= 3&nbsp;* 10<sup>5</sup></code></li>
5555
<li><code>s</code> 由数字、<code>'+'</code>、<code>'-'</code>、<code>'('</code>、<code>')'</code>、和 <code>' '</code> 组成</li>
5656
<li><code>s</code> 表示一个有效的表达式</li>
57-
<li><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> 不能用作一元运算(例如, <font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.6px"><span style="background-color:#f9f2f4">"+1"</span></span></font></font>&nbsp;和 <code>"+(2 + 3)"</code>&nbsp;无效)</li>
58-
<li><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> 可以用作一元运算(即 <font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.6px"><span style="background-color:#f9f2f4">"-1"</span></span></font></font>&nbsp;和 <code>"-(2 + 3)"</code>&nbsp;是有效的)</li>
57+
<li><code>'+'</code>&nbsp;不能用作一元运算(例如, <code>"+1"</code>&nbsp;和 <code>"+(2 + 3)"</code>&nbsp;无效)</li>
58+
<li><code>'-'</code>&nbsp;可以用作一元运算(即 <code>"-1"</code>&nbsp;和 <code>"-(2 + 3)"</code>&nbsp;是有效的)</li>
5959
<li>输入中不存在两个连续的操作符</li>
6060
<li>每个数字和运行的计算将适合于一个有符号的 32位 整数</li>
6161
</ul>

solution/0300-0399/0334.Increasing Triplet Subsequence/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tags:
4343
<pre>
4444
<strong>输入:</strong>nums = [2,1,5,0,4,6]
4545
<strong>输出:</strong>true
46-
<strong>解释:</strong>其中一个满足题意的三元组是 (3, 4, 5),因为 nums[3] == 0 &lt; nums[4] == 4 &lt; nums[5] == 6
46+
<strong>解释:</strong>其中一个满足题意的三元组是 (1, 4, 5),因为 nums[1] == 1 &lt; nums[4] == 4 &lt; nums[5] == 6
4747
</pre>
4848

4949
<p>&nbsp;</p>

solution/0300-0399/0334.Increasing Triplet Subsequence/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tags:
4141
<pre>
4242
<strong>Input:</strong> nums = [2,1,5,0,4,6]
4343
<strong>Output:</strong> true
44-
<strong>Explanation:</strong> One of the valid triplet is (3, 4, 5), because nums[3] == 0 &lt; nums[4] == 4 &lt; nums[5] == 6.
44+
<strong>Explanation:</strong> One of the valid triplet is (1, 4, 5), because nums[1] == 1 &lt; nums[4] == 4 &lt; nums[5] == 6.
4545
</pre>
4646

4747
<p>&nbsp;</p>

solution/0300-0399/0352.Data Stream as Disjoint Intervals/README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,28 @@ tags:
2121

2222
<!-- description:start -->
2323

24-
<p>&nbsp;给你一个由非负整数&nbsp;<code>a<sub>1</sub>, a<sub>2</sub>, ..., a<sub>n</sub></code> 组成的数据流输入,请你将到目前为止看到的数字总结为不相交的区间列表。</p>
24+
<p>给你一个由非负整数组成的数据流输入 <code>a<sub>1</sub>, a<sub>2</sub>, ..., a<sub>n</sub></code>,请你将目前为止看到的数字汇总为一组不相交的区间列表。</p>
2525

2626
<p>实现 <code>SummaryRanges</code> 类:</p>
2727

28-
<div class="original__bRMd">
29-
<div>
3028
<ul>
31-
<li><code>SummaryRanges()</code> 使用一个空数据流初始化对象。</li>
32-
<li><code>void addNum(int val)</code> 向数据流中加入整数 <code>val</code> 。</li>
33-
<li><code>int[][] getIntervals()</code> 以不相交区间&nbsp;<code>[start<sub>i</sub>, end<sub>i</sub>]</code> 的列表形式返回对数据流中整数的总结。</li>
29+
<li><code>SummaryRanges()</code> 初始化一个空的数据流对象。</li>
30+
<li><code>void addNum(int value)</code> 将整数 <code>value</code> 添加到数据流中。</li>
31+
<li><code>int[][] getIntervals()</code> 返回当前数据流中的整数汇总为一组不相交的区间列表 <code>[start<sub>i</sub>, end<sub>i</sub>]</code>。答案应按 <code>start<sub>i</sub></code> 升序排序。</li>
3432
</ul>
3533

3634
<p>&nbsp;</p>
3735

38-
<p><strong>示例:</strong></p>
36+
<p><strong class="example">示例 1:</strong></p>
3937

4038
<pre>
41-
<strong>输入</strong>
39+
<strong>输入</strong>
4240
["SummaryRanges", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals"]
4341
[[], [1], [], [3], [], [7], [], [2], [], [6], []]
44-
<strong>输出</strong>
42+
<strong>输出</strong>
4543
[null, null, [[1, 1]], null, [[1, 1], [3, 3]], null, [[1, 1], [3, 3], [7, 7]], null, [[1, 3], [7, 7]], null, [[1, 3], [6, 7]]]
4644

47-
<strong>解释</strong>
45+
<strong>解释</strong>
4846
SummaryRanges summaryRanges = new SummaryRanges();
4947
summaryRanges.addNum(1); // arr = [1]
5048
summaryRanges.getIntervals(); // 返回 [[1, 1]]
@@ -63,11 +61,10 @@ summaryRanges.getIntervals(); // 返回 [[1, 3], [6, 7]]
6361
<p><strong>提示:</strong></p>
6462

6563
<ul>
66-
<li><code>0 &lt;= val &lt;= 10<sup>4</sup></code></li>
67-
<li>最多调用&nbsp;<code>addNum</code> 和 <code>getIntervals</code> 方法 <code>3 * 10<sup>4</sup></code> 次</li>
64+
<li><code>0 &lt;= value &lt;= 10<sup>4</sup></code></li>
65+
<li>最多会调用 <code>addNum</code> 和 <code>getIntervals</code> 方法 <code>3 * 10<sup>4</sup></code> 次。</li>
66+
<li>最多会调用 <code>getIntervals</code> 方法 <code>10<sup>2</sup></code> 次。</li>
6867
</ul>
69-
</div>
70-
</div>
7168

7269
<p>&nbsp;</p>
7370

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0442.Fi
55
tags:
66
- 数组
77
- 哈希表
8+
- 排序
89
---
910

1011
<!-- problem:start -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0442.Fi
55
tags:
66
- Array
77
- Hash Table
8+
- Sorting
89
---
910

1011
<!-- problem:start -->

solution/0600-0699/0649.Dota2 Senate/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tags:
2323
<p>Dota2 参议院由来自两派的参议员组成。现在参议院希望对一个 Dota2 游戏里的改变作出决定。他们以一个基于轮为过程的投票进行。在每一轮中,每一位参议员都可以行使两项权利中的 <strong>一 </strong>项:</p>
2424

2525
<ul>
26-
<li><strong>禁止一名参议员的权利</strong>:参议员可以让另一位参议员在这一轮和随后的几轮中丧失<strong> 所有的权利 </strong>。</li>
26+
<li><strong>剥夺一名参议员的权利</strong>:一名参议员可以使另一名参议员在本轮及所有后续轮次中失去所有权利。</li>
2727
<li><strong>宣布胜利</strong>:如果参议员发现有权利投票的参议员都是 <strong>同一个阵营的</strong> ,他可以宣布胜利并决定在游戏中的有关变化。</li>
2828
</ul>
2929

0 commit comments

Comments
 (0)