Skip to content

Commit 1838ba4

Browse files
authored
feat: update lc problems (#4599)
1 parent 721ac60 commit 1838ba4

File tree

45 files changed

+253
-136
lines changed

Some content is hidden

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

45 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>

0 commit comments

Comments
 (0)