Skip to content

Commit 4710a05

Browse files
committed
feat: update lc problems
1 parent 2bc0266 commit 4710a05

File tree

48 files changed

+249
-231
lines changed

Some content is hidden

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

48 files changed

+249
-231
lines changed

solution/0000-0099/0015.3Sum/README_EN.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,39 @@
1010

1111
<p>&nbsp;</p>
1212
<p><strong>Example 1:</strong></p>
13-
<pre><strong>Input:</strong> nums = [-1,0,1,2,-1,-4]
13+
14+
<pre>
15+
<strong>Input:</strong> nums = [-1,0,1,2,-1,-4]
1416
<strong>Output:</strong> [[-1,-1,2],[-1,0,1]]
15-
</pre><p><strong>Example 2:</strong></p>
16-
<pre><strong>Input:</strong> nums = []
17-
<strong>Output:</strong> []
18-
</pre><p><strong>Example 3:</strong></p>
19-
<pre><strong>Input:</strong> nums = [0]
17+
<strong>Explanation:</strong>
18+
nums[0] + nums[1] + nums[1] = (-1) + 0 + 1 = 0.
19+
nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.
20+
nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.
21+
The distinct triplets are [-1,0,1] and [-1,-1,2].
22+
Notice that the order of the output and the order of the triplets does not matter.
23+
</pre>
24+
25+
<p><strong>Example 2:</strong></p>
26+
27+
<pre>
28+
<strong>Input:</strong> nums = [0,1,1]
2029
<strong>Output:</strong> []
30+
<strong>Explanation:</strong> The only possible triplet does not sum up to 0.
2131
</pre>
32+
33+
<p><strong>Example 3:</strong></p>
34+
35+
<pre>
36+
<strong>Input:</strong> nums = [0,0,0]
37+
<strong>Output:</strong> [[0,0,0]]
38+
<strong>Explanation:</strong> The only possible triplet sums up to 0.
39+
</pre>
40+
2241
<p>&nbsp;</p>
2342
<p><strong>Constraints:</strong></p>
2443

2544
<ul>
26-
<li><code>0 &lt;= nums.length &lt;= 3000</code></li>
45+
<li><code>3 &lt;= nums.length &lt;= 3000</code></li>
2746
<li><code>-10<sup>5</sup> &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
2847
</ul>
2948

solution/0100-0199/0155.Min Stack/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<li><code>int getMin()</code> retrieves the minimum element in the stack.</li>
1717
</ul>
1818

19+
<p>You must implement a solution with <code>O(1)</code> time complexity for each function.</p>
20+
1921
<p>&nbsp;</p>
2022
<p><strong>Example 1:</strong></p>
2123

solution/0100-0199/0162.Find Peak Element/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
<p>A peak element is an element that is strictly greater than its neighbors.</p>
88

9-
<p>Given an integer array <code>nums</code>, find a peak element, and return its index. If&nbsp;the array contains multiple peaks, return the index to <strong>any of the peaks</strong>.</p>
9+
<p>Given a <strong>0-indexed</strong> integer array <code>nums</code>, find a peak element, and return its index. If the array contains multiple peaks, return the index to <strong>any of the peaks</strong>.</p>
1010

11-
<p>You may imagine that <code>nums[-1] = nums[n] = -&infin;</code>.</p>
11+
<p>You may imagine that <code>nums[-1] = nums[n] = -&infin;</code>. In other words, an element is always considered to be strictly greater than a neighbor that is outside the array.</p>
1212

13-
<p>You must write an algorithm that runs in&nbsp;<code>O(log n)</code> time.</p>
13+
<p>You must write an algorithm that runs in <code>O(log n)</code> time.</p>
1414

1515
<p>&nbsp;</p>
1616
<p><strong>Example 1:</strong></p>

solution/0200-0299/0223.Rectangle Area/README_EN.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
<p><strong>Constraints:</strong></p>
3030

3131
<ul>
32-
<li><code>-10<sup>4</sup> &lt;= ax1, ay1, ax2, ay2, bx1, by1, bx2, by2 &lt;= 10<sup>4</sup></code></li>
32+
<li><code>-10<sup>4</sup> &lt;= ax1 &lt;= ax2 &lt;= 10<sup>4</sup></code></li>
33+
<li><code>-10<sup>4</sup> &lt;= ay1 &lt;= ay2 &lt;= 10<sup>4</sup></code></li>
34+
<li><code>-10<sup>4</sup> &lt;= bx1 &lt;= bx2 &lt;= 10<sup>4</sup></code></li>
35+
<li><code>-10<sup>4</sup> &lt;= by1 &lt;= by2 &lt;= 10<sup>4</sup></code></li>
3336
</ul>
3437

3538
## Solutions

solution/0300-0399/0320.Generalized Abbreviation/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<ul>
1212
<li>例如,<code>"abcde"</code> 可以缩写为:
13+
1314
<ul>
1415
<li><code>"a3e"</code>(<code>"bcd"</code> 变为 <code>"3"</code> )</li>
1516
<li><code>"1bcd1"</code>(<code>"a"</code> 和 <code>"e"</code> 都变为 <code>"1"</code>)<meta charset="UTF-8" /></li>
@@ -23,6 +24,7 @@
2324
<li><meta charset="UTF-8" /><code>"22de"</code>&nbsp;(<code>"ab"</code> 变为&nbsp;<code>"2"</code>&nbsp;,&nbsp;<code>"bc"</code>&nbsp;变为&nbsp;<code>"2"</code>) &nbsp;是无效的,因为被选择的字符串是重叠的</li>
2425
</ul>
2526
</li>
27+
2628
</ul>
2729

2830
<p>给你一个字符串&nbsp;<code>word</code> ,返回&nbsp;<em>一个由</em>&nbsp;<code>word</code> 的<em>所有可能 <strong>广义缩写词</strong> 组成的列表</em>&nbsp;。按 <strong>任意顺序</strong> 返回答案。</p>

solution/0300-0399/0336.Palindrome Pairs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<strong>输出:</strong>[[0,1],[1,0]]
3333
</pre>
3434

35+
36+
3537
<p><strong>提示:</strong></p>
3638

3739
<ul>

solution/0500-0599/0554.Brick Wall/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
<strong>输出:</strong>3
2929
</pre>
3030

31+
32+
3133
<p><strong>提示:</strong></p>
3234

3335
<ul>

solution/0500-0599/0560.Subarray Sum Equals K/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给你一个整数数组 <code>nums</code> 和一个整数&nbsp;<code>k</code> ,请你统计并返回 <em>该数组中和为&nbsp;<code>k</code><strong>&nbsp;</strong>的子数组的个数&nbsp;</em>。</p>
9+
<p>给你一个整数数组 <code>nums</code> 和一个整数&nbsp;<code>k</code> ,请你统计并返回 <em>该数组中和为&nbsp;<code>k</code><strong>&nbsp;</strong>的连续子数组的个数&nbsp;</em>。</p>
1010

1111
<p>&nbsp;</p>
1212

solution/0500-0599/0561.Array Partition/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
4242
</ul>
4343

44-
4544
## 解法
4645

4746
<!-- 这里可写通用的实现逻辑 -->

solution/0500-0599/0561.Array Partition/README_EN.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ So the maximum possible sum is 4.</pre>
3535
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
3636
</ul>
3737

38-
3938
## Solutions
4039

4140
<!-- tabs:start -->

0 commit comments

Comments
 (0)