Skip to content

Commit d716645

Browse files
committed
chore: update lc problems
1 parent 394dffb commit d716645

File tree

38 files changed

+229
-230
lines changed

38 files changed

+229
-230
lines changed

solution/0000-0099/0001.Two Sum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public class Solution {
174174
{
175175
m.Add(v, i);
176176
}
177-
177+
178178
}
179179
return null;
180180
}

solution/0000-0099/0001.Two Sum/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class Solution {
135135
{
136136
m.Add(v, i);
137137
}
138-
138+
139139
}
140140
return null;
141141
}

solution/0100-0199/0146.LRU Cache/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<li><code>void put(int key, int value)</code>&nbsp;Update the value of the <code>key</code> if the <code>key</code> exists. Otherwise, add the <code>key-value</code> pair to the cache. If the number of keys exceeds the <code>capacity</code> from this operation, <strong>evict</strong> the least recently used key.</li>
1515
</ul>
1616

17-
<p>The functions&nbsp;<code data-stringify-type="code">get</code>&nbsp;and&nbsp;<code data-stringify-type="code">put</code>&nbsp;must each run in <code>O(1)</code> average time complexity.</p>
17+
<p>The functions <code data-stringify-type="code">get</code> and <code data-stringify-type="code">put</code>&nbsp;must each run in <code>O(1)</code> average time complexity.</p>
1818

1919
<p>&nbsp;</p>
2020
<p><strong>Example 1:</strong></p>
@@ -46,7 +46,7 @@ lRUCache.get(4); // return 4
4646
<li><code>1 &lt;= capacity &lt;= 3000</code></li>
4747
<li><code>0 &lt;= key &lt;= 10<sup>4</sup></code></li>
4848
<li><code>0 &lt;= value &lt;= 10<sup>5</sup></code></li>
49-
<li>At most 2<code>&nbsp;* 10<sup>5</sup></code>&nbsp;calls will be made to <code>get</code> and <code>put</code>.</li>
49+
<li>At most <code>2 * 10<sup>5</sup></code> calls will be made to <code>get</code> and <code>put</code>.</li>
5050
</ul>
5151

5252
## Solutions

solution/0100-0199/0159.Longest Substring with At Most Two Distinct Characters/README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,35 @@
66

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

9-
<p>给定一个字符串<strong><em> s</em></strong> ,找出&nbsp;<strong>至多&nbsp;</strong>包含两个不同字符的最长子串 <strong><em>t</em> </strong>,并返回该子串的长度。</p>
9+
给你一个字符串 <code>s</code> ,请你找出&nbsp;<strong>至多&nbsp;</strong>包含 <strong>两个不同字符</strong> 的最长子串,并返回该子串的长度。
1010

11-
<p><strong>示例 1:</strong></p>
11+
<p>&nbsp;</p>
1212

13-
<pre><strong>输入:</strong> &quot;eceba&quot;
14-
<strong>输出: </strong>3
15-
<strong>解释: <em>t</em></strong> 是 &quot;ece&quot;,长度为3。
13+
<p><strong>示例 1:</strong></p>
14+
15+
<pre>
16+
<strong>输入:</strong>s = "eceba"
17+
<strong>输出:</strong>3
18+
<strong>解释:</strong>满足题目要求的子串是 "ece" ,长度为 3 。
1619
</pre>
1720

18-
<p><strong>示例 2:</strong></p>
21+
<p><strong>示例 2</strong></p>
1922

20-
<pre><strong>输入:</strong> &quot;ccaabbb&quot;
21-
<strong>输出: </strong>5
22-
<strong>解释: <em>t</em></strong><em> </em>是 &quot;aabbb&quot;,长度为5。
23+
<pre>
24+
<strong>输入:</strong>s = "ccaabbb"
25+
<strong>输出:</strong>5
26+
<strong>解释:</strong>满足题目要求的子串是 "aabbb" ,长度为 5 。
2327
</pre>
2428

29+
<p>&nbsp;</p>
30+
31+
<p><strong>提示:</strong></p>
32+
33+
<ul>
34+
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
35+
<li><code>s</code> 由英文字母组成</li>
36+
</ul>
37+
2538
## 解法
2639

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

solution/0200-0299/0215.Kth Largest Element in an Array/README.md

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

1111
<p>请注意,你需要找的是数组排序后的第 <code>k</code> 个最大的元素,而不是第 <code>k</code> 个不同的元素。</p>
1212

13+
<p>你必须设计并实现时间复杂度为 <code>O(n)</code> 的算法解决此问题。</p>
14+
1315
<p>&nbsp;</p>
1416

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

solution/0300-0399/0304.Range Sum Query 2D - Immutable/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<li><code>int sumRegion(int row1, int col1, int row2, int col2)</code> Returns the <strong>sum</strong> of the elements of <code>matrix</code> inside the rectangle defined by its <strong>upper left corner</strong> <code>(row1, col1)</code> and <strong>lower right corner</strong> <code>(row2, col2)</code>.</li>
1818
</ul>
1919

20+
<p>You must design an algorithm where <code>sumRegion</code> works on <code>O(1)</code> time complexity.</p>
21+
2022
<p>&nbsp;</p>
2123
<p><strong>Example 1:</strong></p>
2224
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0304.Range%20Sum%20Query%202D%20-%20Immutable/images/sum-grid.jpg" style="width: 415px; height: 415px;" />

solution/0300-0399/0340.Longest Substring with At Most K Distinct Characters/README.md

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

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

9-
<p>给定一个字符串<strong><em> <code>s</code></em></strong> ,找出 <strong>至多 </strong>包含<em> <code>k</code></em> 个不同字符的最长子串 <strong><em>T</em></strong>。</p>
9+
<p>给你一个字符串 <code>s</code> 和一个整数 <code>k</code> ,请你找出&nbsp;<strong>至多&nbsp;</strong>包含<em> <code>k</code></em> <strong>不同</strong> 字符的最长子串,并返回该子串的长度。</p>
1010

11-
<p> </p>
11+
<p>&nbsp;</p>
1212

13-
<p><strong>示例 1:</strong></p>
13+
<p><strong>示例 1</strong></p>
1414

1515
<pre>
16-
<strong>输入: </strong>s = "eceba", k = 2
17-
<strong>输出: </strong>3
18-
<strong>解释: </strong>则<strong> </strong>T 为 "ece",所以长度为 3。</pre>
16+
<strong>输入</strong>s = "eceba", k = 2
17+
<strong>输出</strong>3
18+
<strong>解释</strong>满足题目要求的子串是 "ece" ,长度为 3 。</pre>
1919

20-
<p><strong>示例 2:</strong></p>
20+
<p><strong>示例 2</strong></p>
2121

2222
<pre>
23-
<strong>输入: </strong>s = "aa", k = 1
24-
<strong>输出: </strong>2
25-
<strong>解释: </strong>则 T 为 "aa",所以长度为 2
23+
<strong>输入</strong>s = "aa", k = 1
24+
<strong>输出</strong>2
25+
<strong>解释</strong>满足题目要求的子串是 "aa" ,长度为 2
2626
</pre>
2727

28-
<p> </p>
28+
<p>&nbsp;</p>
2929

3030
<p><strong>提示:</strong></p>
3131

3232
<ul>
33-
<li><code>1 <= s.length <= 5 * 10<sup>4</sup></code></li>
34-
<li><code>0 <= k <= 50</code></li>
33+
<li><code>1 &lt;= s.length &lt;= 5 * 10<sup>4</sup></code></li>
34+
<li><code>0 &lt;= k &lt;= 50</code></li>
3535
</ul>
3636

3737
## 解法

solution/0600-0699/0626.Exchange Seats/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| Column Name | Type |
1212
+-------------+---------+
1313
| id | int |
14-
| name | varchar |
14+
| student | varchar |
1515
+-------------+---------+
1616
id is the primary key column for this table.
1717
Each row of this table indicates the name and the ID of a student.

solution/0600-0699/0636.Exclusive Time of Functions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function exclusiveTime(n: number, logs: string[]): number[] {
176176
}
177177
}
178178
}
179-
179+
180180
return res;
181181
}
182182
```

solution/0600-0699/0636.Exclusive Time of Functions/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function exclusiveTime(n: number, logs: string[]): number[] {
150150
}
151151
}
152152
}
153-
153+
154154
return res;
155155
}
156156
```

0 commit comments

Comments
 (0)