Skip to content

Commit 0f30fe5

Browse files
authored
feat: update lc problems (doocs#4670)
1 parent 1eb9f7f commit 0f30fe5

File tree

37 files changed

+108
-94
lines changed

37 files changed

+108
-94
lines changed

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

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

2020
<p>整数数组 <code>nums</code> 按升序排列,数组中的值 <strong>互不相同</strong> 。</p>
2121

22-
<p>在传递给函数之前,<code>nums</code> 在预先未知的某个下标 <code>k</code>(<code>0 &lt;= k &lt; nums.length</code>)上进行了 <strong>旋转</strong>,使数组变为 <code>[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]</code>(下标 <strong>从 0 开始</strong> 计数)。例如, <code>[0,1,2,4,5,6,7]</code> 向左旋转&nbsp;<code>3</code>&nbsp;次后可能变为&nbsp;<code>[4,5,6,7,0,1,2]</code> 。</p>
22+
<p>在传递给函数之前,<code>nums</code> 在预先未知的某个下标 <code>k</code>(<code>0 &lt;= k &lt; nums.length</code>)上进行了 <strong>向左旋转</strong>,使数组变为 <code>[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]</code>(下标 <strong>从 0 开始</strong> 计数)。例如, <code>[0,1,2,4,5,6,7]</code> 下标&nbsp;<code>3</code>&nbsp;上向左旋转后可能变为&nbsp;<code>[4,5,6,7,0,1,2]</code> 。</p>
2323

2424
<p>给你 <strong>旋转后</strong> 的数组 <code>nums</code> 和一个整数 <code>target</code> ,如果 <code>nums</code> 中存在这个目标值 <code>target</code> ,则返回它的下标,否则返回&nbsp;<code>-1</code>&nbsp;。</p>
2525

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,46 @@ tags:
2020

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

23-
<p>给定一个 <code>m x n</code> 二维字符网格 <code>board</code> 和一个字符串单词 <code>word</code> 。如果 <code>word</code> 存在于网格中,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
23+
<p>给定一个&nbsp;<code>m x n</code> 二维字符网格&nbsp;<code>board</code> 和一个字符串单词&nbsp;<code>word</code> 。如果&nbsp;<code>word</code> 存在于网格中,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
2424

2525
<p>单词必须按照字母顺序,通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同一个单元格内的字母不允许被重复使用。</p>
2626

27-
<p> </p>
27+
<p>&nbsp;</p>
2828

2929
<p><strong>示例 1:</strong></p>
3030
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0079.Word%20Search/images/word2.jpg" style="width: 322px; height: 242px;" />
3131
<pre>
32-
<strong>输入:</strong>board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"
32+
<strong>输入:</strong>board = [['A','B','C','E'],['S','F','C','S'],['A','D','E','E']], word = "ABCCED"
3333
<strong>输出:</strong>true
3434
</pre>
3535

3636
<p><strong>示例 2:</strong></p>
3737
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0079.Word%20Search/images/word-1.jpg" style="width: 322px; height: 242px;" />
3838
<pre>
39-
<strong>输入:</strong>board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE"
39+
<strong>输入:</strong>board = [['A','B','C','E'],['S','F','C','S'],['A','D','E','E']], word = "SEE"
4040
<strong>输出:</strong>true
4141
</pre>
4242

4343
<p><strong>示例 3:</strong></p>
4444
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0079.Word%20Search/images/word3.jpg" style="width: 322px; height: 242px;" />
4545
<pre>
46-
<strong>输入:</strong>board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB"
46+
<strong>输入:</strong>board = [['A','B','C','E'],['S','F','C','S'],['A','D','E','E']], word = "ABCB"
4747
<strong>输出:</strong>false
4848
</pre>
4949

50-
<p> </p>
50+
<p>&nbsp;</p>
5151

5252
<p><strong>提示:</strong></p>
5353

5454
<ul>
5555
<li><code>m == board.length</code></li>
5656
<li><code>n = board[i].length</code></li>
57-
<li><code>1 <= m, n <= 6</code></li>
58-
<li><code>1 <= word.length <= 15</code></li>
57+
<li><code>1 &lt;= m, n &lt;= 6</code></li>
58+
<li><code>1 &lt;= word.length &lt;= 15</code></li>
5959
<li><code>board</code> 和 <code>word</code> 仅由大小写英文字母组成</li>
6060
</ul>
6161

62-
<p> </p>
62+
<p>&nbsp;</p>
6363

6464
<p><strong>进阶:</strong>你可以使用搜索剪枝的技术来优化解决方案,使其在 <code>board</code> 更大的情况下可以更快解决问题?</p>
6565

solution/0100-0199/0190.Reverse Bits/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ tags:
1919

2020
<p>颠倒给定的 32 位无符号整数的二进制位。</p>
2121

22-
<p><strong>提示:</strong></p>
23-
24-
<ul>
25-
<li>请注意,在某些语言(如 Java)中,没有无符号整数类型。在这种情况下,输入和输出都将被指定为有符号整数类型,并且不应影响您的实现,因为无论整数是有符号的还是无符号的,其内部的二进制表示形式都是相同的。</li>
26-
<li>在 Java 中,编译器使用<a href="https://baike.baidu.com/item/二进制补码/5295284" target="_blank">二进制补码</a>记法来表示有符号整数。</li>
27-
</ul>
28-
2922
<p>&nbsp;</p>
3023

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

solution/0100-0199/0190.Reverse Bits/README_EN.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@ tags:
1717

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

20-
<p>Reverse bits of a given 32 bits unsigned integer.</p>
21-
22-
<p><strong>Note:</strong></p>
23-
24-
<ul>
25-
<li>Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer&#39;s internal binary representation is the same, whether it is signed or unsigned.</li>
26-
<li>In Java, the compiler represents the signed integers using <a href="https://en.wikipedia.org/wiki/Two%27s_complement" target="_blank">2&#39;s complement notation</a>.</li>
27-
</ul>
20+
<p>Reverse bits of a given 32 bits signed integer.</p>
2821

2922
<p>&nbsp;</p>
3023
<p><strong class="example">Example 1:</strong></p>

solution/0200-0299/0294.Flip Game II/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ tags:
4848
<ul>
4949
<li><code>1 &lt;= currentState.length &lt;= 60</code></li>
5050
<li><code>currentState[i]</code> 不是 <code>'+'</code> 就是 <code>'-'</code></li>
51+
<li>不能有超过 20 个连续的&nbsp;<code>'+'</code>。</li>
5152
</ul>
5253

5354
<p>&nbsp;</p>

solution/0200-0299/0294.Flip Game II/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ tags:
4848
<ul>
4949
<li><code>1 &lt;= currentState.length &lt;= 60</code></li>
5050
<li><code>currentState[i]</code> is either <code>&#39;+&#39;</code> or <code>&#39;-&#39;</code>.</li>
51+
<li>There cannot be more than 20 consecutive <code>&#39;+&#39;</code>.</li>
5152
</ul>
5253

5354
<p>&nbsp;</p>

solution/0200-0299/0295.Find Median from Data Stream/README.md

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

3232
<ul>
3333
<li>
34-
<p><code>MedianFinder() </code>初始化 <code>MedianFinder</code>&nbsp;对象。</p>
34+
<p><code>MedianFinder()</code> 初始化 <code>MedianFinder</code>&nbsp;对象。</p>
3535
</li>
3636
<li>
3737
<p><code>void addNum(int num)</code> 将数据流中的整数 <code>num</code> 添加到数据结构中。</p>

solution/0300-0399/0347.Top K Frequent Elements/README_EN.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,29 @@ tags:
2727

2828
<p>&nbsp;</p>
2929
<p><strong class="example">Example 1:</strong></p>
30-
<pre><strong>Input:</strong> nums = [1,1,1,2,2,3], k = 2
31-
<strong>Output:</strong> [1,2]
32-
</pre><p><strong class="example">Example 2:</strong></p>
33-
<pre><strong>Input:</strong> nums = [1], k = 1
34-
<strong>Output:</strong> [1]
35-
</pre>
30+
31+
<div class="example-block">
32+
<p><strong>Input:</strong> <span class="example-io">nums = [1,1,1,2,2,3], k = 2</span></p>
33+
34+
<p><strong>Output:</strong> <span class="example-io">[1,2]</span></p>
35+
</div>
36+
37+
<p><strong class="example">Example 2:</strong></p>
38+
39+
<div class="example-block">
40+
<p><strong>Input:</strong> <span class="example-io">nums = [1], k = 1</span></p>
41+
42+
<p><strong>Output:</strong> <span class="example-io">[1]</span></p>
43+
</div>
44+
45+
<p><strong class="example">Example 3:</strong></p>
46+
47+
<div class="example-block">
48+
<p><strong>Input:</strong> <span class="example-io">nums = [1,2,1,2,1,2,3,1,3,2], k = 2</span></p>
49+
50+
<p><strong>Output:</strong> <span class="example-io">[-1]</span></p>
51+
</div>
52+
3653
<p>&nbsp;</p>
3754
<p><strong>Constraints:</strong></p>
3855

solution/0300-0399/0374.Guess Number Higher or Lower/README.md

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

2020
<p>我们正在玩猜数字游戏。猜数字游戏的规则如下:</p>
2121

22-
<p>我会从&nbsp;<code>1</code>&nbsp;&nbsp;<code>n</code> 随机选择一个数字。 请你猜选出的是哪个数字。</p>
22+
<p>我会从&nbsp;<code>1</code>&nbsp;&nbsp;<code>n</code> 随机选择一个数字。 请你猜选出的是哪个数字。(我选的数字在整个游戏中保持不变)。</p>
2323

2424
<p>如果你猜错了,我会告诉你,我选出的数字比你猜测的数字大了还是小了。</p>
2525

solution/0300-0399/0374.Guess Number Higher or Lower/README_EN.md

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

2020
<p>We are playing the Guess Game. The game is as follows:</p>
2121

22-
<p>I pick a number from <code>1</code> to <code>n</code>. You have to guess which number I picked.</p>
22+
<p>I pick a number from <code>1</code> to <code>n</code>. You have to guess which number I picked (the number I picked stays the same throughout the game).</p>
2323

2424
<p>Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess.</p>
2525

0 commit comments

Comments
 (0)