Skip to content

Commit 58bf8ea

Browse files
authored
feat: update lc problems (#5158)
1 parent 93c20ae commit 58bf8ea

37 files changed

Lines changed: 138 additions & 101 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ tags:
77
- 数组
88
- 哈希表
99
- 字符串
10+
- 哈希函数
1011
---
1112

1213
<!-- problem:start -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ tags:
77
- Array
88
- Hash Table
99
- String
10+
- Hash Function
1011
---
1112

1213
<!-- problem:start -->

solution/0400-0499/0466.Count The Repetitions/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0466.Count%20The%20Repetitions/README.md
55
tags:
6+
- 双指针
67
- 字符串
78
- 动态规划
89
---

solution/0400-0499/0466.Count The Repetitions/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0466.Count%20The%20Repetitions/README_EN.md
55
tags:
6+
- Two Pointers
67
- String
78
- Dynamic Programming
89
---

solution/0600-0699/0642.Design Search Autocomplete System/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ tags:
6060

6161
<strong>解释</strong>
6262
AutocompleteSystem obj = new AutocompleteSystem(["i love you", "island", "iroman", "i love leetcode"], [5, 3, 2, 2]);
63-
obj.input("i"); // return ["i love you", "island", "i love leetcode"]. There are four sentences that have prefix "i". Among them, "ironman" and "i love leetcode" have same hot degree. Since ' ' has ASCII code 32 and 'r' has ASCII code 114, "i love leetcode" should be in front of "ironman". Also we only need to output top 3 hot sentences, so "ironman" will be ignored.
64-
obj.input(" "); // return ["i love you", "i love leetcode"]. There are only two sentences that have prefix "i ".
65-
obj.input("a"); // return []. There are no sentences that have prefix "i a".
66-
obj.input("#"); // return []. The user finished the input, the sentence "i a" should be saved as a historical sentence in system. And the following input will be counted as a new search.
63+
obj.input("i"); // 返回 ["i love you", "island", "i love leetcode"]。有四个句子以"i"开头。其中,"ironman""i love leetcode"的热度相同。由于空格的 ASCII 码是 32,而 r 的 ASCII 码是 114,所以“i love leetcode”应排在“ironman”前面。同时我们只需要输出前三句热门句子,因此“ironman”会被忽略。
64+
obj.input(" "); // 返回 ["i love you", "i love leetcode"]。只有两个句子以“i ”为前缀。
65+
obj.input("a"); // 返回 []。没有以“i a”为前缀的句子。
66+
obj.input("#"); // 返回 []。用户完成输入,句子 "i a" 应该被保存为系统中的历史句子。接下来的输入将被视为新的搜索。
6767
</pre>
6868

6969
<p>&nbsp;</p>

solution/0700-0799/0755.Pour Water/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ tags:
1717

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

20-
<p>给出一个地形高度图, <code>heights[i]</code> 表示该索引处的高度。每个索引的宽度为 1。在 <code>V</code> 个单位的水落在索引 <code>K</code> 处以后,每个索引位置有多少水?</p>
20+
<p>给定一个地形高度图,用一个整数数组 <code>heights</code> 表示,其中 <code>heights[i]</code> 表示索引 <code>i</code> 处的地形高度。每个位置的宽度为 <code>1</code>。同时给定两个整数 <code>volume</code> <code>k</code>,表示有 <code>volume</code> 单位的水将落在索引 <code>k</code> 处。</p>
2121

22-
<p>水最先会在索引 <code>K</code> 处下降并且落在该索引位置的最高地形或水面之上。然后按如下方式流动:</p>
22+
<p>水首先落在索引 <code>k</code> 处,并停留在该位置当前的最高高度(地形或已有水)之上。然后,它会按照以下规则流动:</p>
2323

2424
<ul>
25-
<li>如果液滴最终可以通过向左流动而下降,则向左流动。</li>
26-
<li>否则,如果液滴最终可以通过向右流动而下降,则向右流动。</li>
27-
<li>否则,在当前的位置上升。</li>
28-
<li>这里,“最终下降” 的意思是液滴如果按此方向移动的话,最终可以下降到一个较低的水平。而且,“水平”的意思是当前列的地形的高度加上水的高度。</li>
25+
<li>如果水滴向左移动最终会下降,则向左移动。</li>
26+
<li>否则,如果水滴向右移动最终会下降,则向右移动。</li>
27+
<li>否则,停留在当前位置并堆积。</li>
2928
</ul>
3029

31-
<p>我们可以假定在数组两侧的边界外有无限高的地形。而且,不能有部分水在多于 1 个的网格块上均匀分布 - 每个单位的水必须要位于一个块中。</p>
30+
<p>这里,“<strong>最终会下降</strong>”指的是水滴如果沿该方向移动,最终会到达一个更低的高度位置。这里的“高度”是指地形高度加上该位置已有的水量。</p>
3231

33-
<p> </p>
32+
<p>可以假设数组两侧边界之外是无限高的地形。此外,每一单位水必须完全位于某一个格子中,不会被均匀分散到多个格子。</p>
33+
34+
<p>&nbsp;</p>
3435

3536
<p><strong>示例 1:</strong></p>
3637

@@ -42,7 +43,7 @@ tags:
4243
# #
4344
## # ###
4445
#########
45-
0123456 <- 索引
46+
0123456 &lt;- 索引
4647

4748
第一个水滴降落在索引 K = 3 上:
4849

@@ -140,14 +141,14 @@ tags:
140141
<strong>输出:</strong>[4,4,4]
141142
</pre>
142143

143-
<p> </p>
144+
<p>&nbsp;</p>
144145

145146
<p><strong>注:</strong></p>
146147

147148
<ol>
148-
<li><code>heights</code> 的长度为 <code>[1, 100]</code> ,并且每个数的范围为<code>[0, 99]</code>。</li>
149-
<li><code>V</code> 的范围 <code>[0, 2000]</code>。</li>
150-
<li><code>K</code> 的范围 <code>[0, heights.length - 1]</code>。</li>
149+
<li><code>heights</code> 的长度为&nbsp;<code>[1, 100]</code>&nbsp;,并且每个数的范围为<code>[0, 99]</code>。</li>
150+
<li><code>V</code> 的范围&nbsp;<code>[0, 2000]</code>。</li>
151+
<li><code>K</code>&nbsp;的范围&nbsp;<code>[0, heights.length - 1]</code>。</li>
151152
</ol>
152153

153154
<!-- description:end -->

solution/1100-1199/1191.K-Concatenation Maximum Sum/README.md

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

2626
<p>返回修改后的数组中的最大的子数组之和。注意,子数组长度可以是 <code>0</code>,在这种情况下它的总和也是 <code>0</code>。</p>
2727

28-
<p>由于&nbsp;<strong>结果可能会很大</strong>,需要返回的<meta charset="UTF-8" />&nbsp;<code>10<sup>9</sup>&nbsp;+ 7</code>&nbsp;&nbsp;<strong>模</strong>&nbsp;。</p>
28+
<p>由于&nbsp;<strong>结果可能会很大</strong>,需要返回结果对&nbsp;<code>10<sup>9</sup>&nbsp;+ 7</code>&nbsp;&nbsp;<strong>模</strong>。</p>
2929

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

solution/1700-1799/1727.Largest Submatrix With Rearrangements/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ tags:
2121

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

24-
<p>给你一个二进制矩阵 <code>matrix</code> ,它的大小为 <code>m x n</code> ,你可以将 <code>matrix</code> 中的 <strong>列</strong> 按任意顺序重新排列。</p>
24+
<p>给你一个二进制矩阵&nbsp;<code>matrix</code>&nbsp;,它的大小为&nbsp;<code>m x n</code>&nbsp;,你可以将 <code>matrix</code>&nbsp;中的 <strong>列</strong>&nbsp;按任意顺序重新排列。</p>
2525

26-
<p>请你返回最优方案下将 <code>matrix</code> 重新排列后,全是 <code>1</code> 的子矩阵面积。</p>
26+
<p>请你返回最优方案下将 <code>matrix</code>&nbsp;重新排列后,全是 <code>1</code>&nbsp;的最大子矩阵面积。</p>
2727

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

3030
<p><strong>示例 1:</strong></p>
3131

@@ -63,15 +63,15 @@ tags:
6363
<b>输出:</b>0
6464
<b>解释:</b>由于矩阵中没有 1 ,没有任何全 1 的子矩阵,所以面积为 0 。</pre>
6565

66-
<p> </p>
66+
<p>&nbsp;</p>
6767

6868
<p><strong>提示:</strong></p>
6969

7070
<ul>
7171
<li><code>m == matrix.length</code></li>
7272
<li><code>n == matrix[i].length</code></li>
73-
<li><code>1 <= m * n <= 10<sup>5</sup></code></li>
74-
<li><code>matrix[i][j]</code> 要么是 <code>0</code> ,要么是 <code>1</code> 。</li>
73+
<li><code>1 &lt;= m * n &lt;= 10<sup>5</sup></code></li>
74+
<li><code>matrix[i][j]</code>&nbsp;要么是&nbsp;<code>0</code>&nbsp;,要么是&nbsp;<code>1</code> 。</li>
7575
</ul>
7676

7777
<!-- description:end -->

solution/1900-1999/1982.Find Array Given Subset Sums/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ rating: 2872
66
source: 第 255 场周赛 Q4
77
tags:
88
- 数组
9-
- 分治
9+
- 哈希表
10+
- 计数
11+
- 排序
1012
---
1113

1214
<!-- problem:start -->

solution/1900-1999/1982.Find Array Given Subset Sums/README_EN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ rating: 2872
66
source: Weekly Contest 255 Q4
77
tags:
88
- Array
9-
- Divide and Conquer
9+
- Hash Table
10+
- Counting
11+
- Sorting
1012
---
1113

1214
<!-- problem:start -->

0 commit comments

Comments
 (0)