Skip to content

Commit fc9a9d8

Browse files
committed
feat: update lc problems
1 parent 721ac60 commit fc9a9d8

File tree

40 files changed

+253
-136
lines changed

40 files changed

+253
-136
lines changed

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

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

2323
<p>给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。</p>
2424

25-
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0017.Letter%20Combinations%20of%20a%20Phone%20Number/images/200px-telephone-keypad2svg.png" style="width: 200px;" /></p>
25+
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0017.Letter%20Combinations%20of%20a%20Phone%20Number/images/1752723054-mfIHZs-image.png" style="width: 200px;" /></p>
2626

2727
<p>&nbsp;</p>
2828

solution/0000-0099/0020.Valid Parentheses/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ tags:
6161
<p><span class="example-io"><b>输出:</b>true</span></p>
6262
</div>
6363

64+
<p><strong class="example">示例 5:</strong></p>
65+
66+
<div class="example-block">
67+
<p><span class="example-io"><b>输入:</b>s = "([)]"</span></p>
68+
69+
<p><span class="example-io"><b>输出:</b>false</span></p>
70+
</div>
71+
6472
<p>&nbsp;</p>
6573

6674
<p><strong>提示:</strong></p>

solution/0000-0099/0020.Valid Parentheses/README_EN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ tags:
6060
<p><strong>Output:</strong> <span class="example-io">true</span></p>
6161
</div>
6262

63+
<p><strong class="example">Example 5:</strong></p>
64+
65+
<div class="example-block">
66+
<p><strong>Input:</strong> <span class="example-io">s = &quot;([)]&quot;</span></p>
67+
68+
<p><strong>Output:</strong> <span class="example-io">false</span></p>
69+
</div>
70+
6371
<p>&nbsp;</p>
6472
<p><strong>Constraints:</strong></p>
6573

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

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,67 @@ tags:
2828

2929
<p>&nbsp;</p>
3030

31-
<p><strong>示例 1:</strong></p>
32-
33-
<pre>
34-
<strong>输入:</strong>n = 00000010100101000001111010011100
35-
<strong>输出:</strong>964176192 (00111001011110000010100101000000)
36-
<strong>解释:</strong>输入的二进制串 <strong>00000010100101000001111010011100 </strong>表示无符号整数<strong> 43261596</strong><strong>,
37-
</strong> 因此返回 964176192,其二进制表示形式为 <strong>00111001011110000010100101000000</strong>。</pre>
38-
39-
<p><strong>示例 2:</strong></p>
40-
41-
<pre>
42-
<strong>输入:</strong>n = 11111111111111111111111111111101
43-
<strong>输出:</strong>3221225471 (10111111111111111111111111111111)
44-
<strong>解释:</strong>输入的二进制串 <strong>11111111111111111111111111111101</strong> 表示无符号整数 4294967293,
45-
&nbsp; 因此返回 3221225471 其二进制表示形式为 <strong>10111111111111111111111111111111 。</strong></pre>
31+
<p><strong class="example">示例 1:</strong></p>
32+
33+
<div class="example-block">
34+
<p><span class="example-io"><b>输入:</b>n = 43261596</span></p>
35+
36+
<p><span class="example-io"><b>输出:</b>964176192</span></p>
37+
38+
<p><strong>解释:</strong></p>
39+
40+
<table>
41+
<tbody>
42+
<tr>
43+
<th>整数</th>
44+
<th>二进制</th>
45+
</tr>
46+
<tr>
47+
<td>43261596</td>
48+
<td>00000010100101000001111010011100</td>
49+
</tr>
50+
<tr>
51+
<td>964176192</td>
52+
<td>00111001011110000010100101000000</td>
53+
</tr>
54+
</tbody>
55+
</table>
56+
</div>
57+
58+
<p><strong class="example">示例 2:</strong></p>
59+
60+
<div class="example-block">
61+
<p><span class="example-io"><b>输入:</b>n = 2147483644</span></p>
62+
63+
<p><span class="example-io"><b>输出:</b>1073741822</span></p>
64+
65+
<p><strong>解释:</strong></p>
66+
67+
<table>
68+
<tbody>
69+
<tr>
70+
<th>整数</th>
71+
<th>二进制</th>
72+
</tr>
73+
<tr>
74+
<td>2147483644</td>
75+
<td>01111111111111111111111111111100</td>
76+
</tr>
77+
<tr>
78+
<td>1073741822</td>
79+
<td>00111111111111111111111111111110</td>
80+
</tr>
81+
</tbody>
82+
</table>
83+
</div>
4684

4785
<p>&nbsp;</p>
4886

4987
<p><strong>提示:</strong></p>
5088

5189
<ul>
52-
<li>输入是一个长度为 <code>32</code> 的二进制字符串</li>
90+
<li><code>0 &lt;= n &lt;= 2<sup>31</sup>&nbsp;- 2</code></li>
91+
<li><code>n</code>&nbsp;为偶数</li>
5392
</ul>
5493

5594
<p>&nbsp;</p>

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

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,70 @@ tags:
2323

2424
<ul>
2525
<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>. Therefore, in <strong class="example">Example 2</strong> above, the input represents the signed integer <code>-3</code> and the output represents the signed integer <code>-1073741825</code>.</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>. Therefore, in <strong class="example">Example 2</strong>&nbsp;below, the input represents the signed integer <code>-3</code> and the output represents the signed integer <code>-1073741825</code>.</li>
2727
</ul>
2828

2929
<p>&nbsp;</p>
3030
<p><strong class="example">Example 1:</strong></p>
3131

32-
<pre>
33-
<strong>Input:</strong> n = 00000010100101000001111010011100
34-
<strong>Output:</strong> 964176192 (00111001011110000010100101000000)
35-
<strong>Explanation: </strong>The input binary string <strong>00000010100101000001111010011100</strong> represents the unsigned integer 43261596, so return 964176192 which its binary representation is <strong>00111001011110000010100101000000</strong>.
36-
</pre>
32+
<div class="example-block">
33+
<p><strong>Input:</strong> <span class="example-io">n = 43261596</span></p>
34+
35+
<p><strong>Output:</strong> <span class="example-io">964176192</span></p>
36+
37+
<p><strong>Explanation:</strong></p>
38+
39+
<table>
40+
<tbody>
41+
<tr>
42+
<th>Integer</th>
43+
<th>Binary</th>
44+
</tr>
45+
<tr>
46+
<td>43261596</td>
47+
<td>00000010100101000001111010011100</td>
48+
</tr>
49+
<tr>
50+
<td>964176192</td>
51+
<td>00111001011110000010100101000000</td>
52+
</tr>
53+
</tbody>
54+
</table>
55+
</div>
3756

3857
<p><strong class="example">Example 2:</strong></p>
3958

40-
<pre>
41-
<strong>Input:</strong> n = 11111111111111111111111111111101
42-
<strong>Output:</strong> 3221225471 (10111111111111111111111111111111)
43-
<strong>Explanation: </strong>The input binary string <strong>11111111111111111111111111111101</strong> represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is <strong>10111111111111111111111111111111</strong>.
44-
</pre>
59+
<div class="example-block">
60+
<p><strong>Input:</strong> <span class="example-io">n = 2147483644</span></p>
61+
62+
<p><strong>Output:</strong> <span class="example-io">1073741822</span></p>
63+
64+
<p><strong>Explanation:</strong></p>
65+
66+
<table>
67+
<tbody>
68+
<tr>
69+
<th>Integer</th>
70+
<th>Binary</th>
71+
</tr>
72+
<tr>
73+
<td>2147483644</td>
74+
<td>01111111111111111111111111111100</td>
75+
</tr>
76+
<tr>
77+
<td>1073741822</td>
78+
<td>00111111111111111111111111111110</td>
79+
</tr>
80+
</tbody>
81+
</table>
82+
</div>
4583

4684
<p>&nbsp;</p>
4785
<p><strong>Constraints:</strong></p>
4886

4987
<ul>
50-
<li>The input must be a <strong>binary string</strong> of length <code>32</code></li>
88+
<li><code>0 &lt;= n &lt;= 2<sup>31</sup> - 2</code></li>
89+
<li><code>n</code> is even.</li>
5190
</ul>
5291

5392
<p>&nbsp;</p>

solution/0200-0299/0282.Expression Add Operators/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ tags:
1818

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

21-
<p>给定一个仅包含数字&nbsp;<code>0-9</code>&nbsp;的字符串 <code>num</code> 和一个目标值整数 <code>target</code> ,在 <code>num</code> 的数字之间添加 <strong>二元 </strong>运算符(不是一元)<code>+</code>、<code>-</code>&nbsp;&nbsp;<code>*</code>&nbsp;,返回 <strong>所有</strong> 能够得到 <code>target </code>的表达式。</p>
21+
<p>给定一个仅包含数字&nbsp;<code>0-9</code>&nbsp;的字符串 <code>num</code> 和一个目标值整数 <code>target</code> ,在 <code>num</code> 的数字之间添加 <strong>二元 </strong>运算符(不是一元)<code>+</code>、<code>-</code>&nbsp;&nbsp;<code>*</code>&nbsp;,返回 <strong>所有</strong> 能够得到 <code>target</code>&nbsp;的表达式。</p>
2222

2323
<p>注意,返回表达式中的操作数 <strong>不应该</strong> 包含前导零。</p>
2424

25+
<p><strong>注意</strong>,一个数字可以包含多个数位。</p>
26+
2527
<p>&nbsp;</p>
2628

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

solution/0300-0399/0348.Design Tic-Tac-Toe/README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tags:
2020

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

23-
<p>请在 n &times;&nbsp;n 的棋盘上,实现一个判定井字棋(Tic-Tac-Toe)胜负的神器,判断每一次玩家落子后,是否有胜出的玩家。</p>
23+
<p>请在 n ×&nbsp;n 的棋盘上,实现一个判定井字棋(Tic-Tac-Toe)胜负的神器,判断每一次玩家落子后,是否有胜出的玩家。</p>
2424

2525
<p>在这个井字棋游戏中,会有 2 名玩家,他们将轮流在棋盘上放置自己的棋子。</p>
2626

@@ -34,7 +34,8 @@ tags:
3434

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

37-
<pre>给定棋盘边长 <em>n</em> = 3, 玩家 1 的棋子符号是 &quot;X&quot;,玩家 2 的棋子符号是 &quot;O&quot;
37+
<pre>
38+
给定棋盘边长 <em>n</em> = 3, 玩家 1 的棋子符号是 "X",玩家 2 的棋子符号是 "O"。
3839

3940
TicTacToe toe = new TicTacToe(3);
4041

@@ -76,7 +77,17 @@ toe.move(2, 1, 1); -&gt; 函数返回 1 (此时,玩家 1 赢得了该场比赛
7677

7778
<p>&nbsp;</p>
7879

79-
<p><strong>进阶:</strong><br>
80+
<p><strong>提示:</strong></p>
81+
82+
<ul>
83+
<li><code>2 &lt;= n &lt;= 100</code></li>
84+
<li>玩家是&nbsp;<code>1</code> 或&nbsp;<code>2</code>。</li>
85+
<li><code>0 &lt;= row, col &lt; n</code></li>
86+
<li>每次调用 <code>move</code>&nbsp;时&nbsp;<code>(row, col)</code>&nbsp;都是不同的。</li>
87+
<li>最多调用&nbsp;<code>move</code>&nbsp;&nbsp;<code>n<sup>2</sup></code>&nbsp;次。</li>
88+
</ul>
89+
90+
<p><strong>进阶:</strong><br />
8091
您有没有可能将每一步的&nbsp;<code>move()</code>&nbsp;操作优化到比&nbsp;O(<em>n</em><sup>2</sup>) 更快吗?</p>
8192

8293
<!-- description:end -->

solution/0300-0399/0391.Perfect Rectangle/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0300-0399/0391.Perfect%20Rectangle/README.md
55
tags:
6+
- 几何
67
- 数组
8+
- 哈希表
9+
- 数学
710
- 扫描线
811
---
912

solution/0300-0399/0391.Perfect Rectangle/README_EN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0300-0399/0391.Perfect%20Rectangle/README_EN.md
55
tags:
6+
- Geometry
67
- Array
8+
- Hash Table
9+
- Math
710
- Line Sweep
811
---
912

solution/0500-0599/0545.Boundary of Binary Tree/README_EN.md

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

2525
<ul>
2626
<li>The root node&#39;s left child is in the left boundary. If the root does not have a left child, then the left boundary is <strong>empty</strong>.</li>
27-
<li>If a node in the left boundary and has a left child, then the left child is in the left boundary.</li>
27+
<li>If a node is in the left boundary and has a left child, then the left child is in the left boundary.</li>
2828
<li>If a node is in the left boundary, has <strong>no</strong> left child, but has a right child, then the right child is in the left boundary.</li>
2929
<li>The leftmost leaf is <strong>not</strong> in the left boundary.</li>
3030
</ul>

0 commit comments

Comments
 (0)