Skip to content

Commit acaedfe

Browse files
authored
feat: update lc problems (doocs#2673)
1 parent a0aa109 commit acaedfe

File tree

19 files changed

+60
-68
lines changed

19 files changed

+60
-68
lines changed

Diff for: solution/0000-0099/0005.Longest Palindromic Substring/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0000-0099/0005.Longest%20Palindromic%20Substring/README_EN.md)
44

5-
<!-- tags:字符串,动态规划 -->
5+
<!-- tags:双指针,字符串,动态规划 -->
66

77
## 题目描述
88

Diff for: solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0000-0099/0005.Longest%20Palindromic%20Substring/README.md)
44

5-
<!-- tags:String,Dynamic Programming -->
5+
<!-- tags:Two Pointers,String,Dynamic Programming -->
66

77
## Description
88

Diff for: solution/0200-0299/0281.Zigzag Iterator/README.md

+32-16
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,46 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给出两个一维的向量,请你实现一个迭代器,交替返回它们中间的元素。</p>
11+
<p>给出两个整数向量&nbsp;<code>v1</code>&nbsp;&nbsp;<code>v2</code>,请你实现一个迭代器,交替返回它们中间的元素。</p>
1212

13-
<p><strong>示例:</strong></p>
13+
<p>实现&nbsp;<code>ZigzagIterator</code>&nbsp;类:</p>
1414

15-
<pre><strong>输入:</strong>
16-
v1 = [1,2]
17-
v2 = [3,4,5,6]
15+
<ul>
16+
<li><code>ZigzagIterator(List&lt;int&gt; v1, List&lt;int&gt; v2)</code>&nbsp;用两个向量&nbsp;<code>v1</code>&nbsp;和&nbsp;<code>v2</code>&nbsp;初始化对象。</li>
17+
<li><code>boolean hasNext()</code>&nbsp;如果迭代器还有元素返回&nbsp;<code>true</code>,否则返回 <code>false</code>。</li>
18+
<li><code>int next()</code>&nbsp;返回迭代器的当前元素并将迭代器移动到下一个元素。</li>
19+
</ul>
1820

19-
<strong>输出:</strong> <code>[1,3,2,4,5,6]
21+
<p><strong class="example">示例 1:</strong></p>
2022

21-
<strong>解析:</strong></code>&nbsp;通过连续调用 <em>next</em> 函数直到 <em>hasNext</em> 函数返回 <code>false,</code>
22-
&nbsp; <em>next</em> 函数返回值的次序应依次为: <code>[1,3,2,4,5,6]。</code></pre>
23+
<pre>
24+
<strong>输入:</strong>v1 = [1,2], v2 = [3,4,5,6]
25+
<strong>输出:</strong>[1,3,2,4,5,6]
26+
<strong>解释:</strong>通过重复调用 next 直到 hasNext 返回 false,那么 next 返回的元素的顺序应该是:[1,3,2,4,5,6]。
27+
</pre>
28+
29+
<p><strong class="example">示例 2:</strong></p>
30+
31+
<pre>
32+
<strong>输入:</strong>v1 = [1], v2 = []
33+
<strong>输出:</strong>[1]
34+
</pre>
35+
36+
<p><strong class="example">示例 3:</strong></p>
2337

24-
<p><strong>拓展:</strong>假如给你&nbsp;<code>k</code>&nbsp;个一维向量呢?你的代码在这种情况下的扩展性又会如何呢?</p>
38+
<pre>
39+
<strong>输入:</strong>v1 = [], v2 = [1]
40+
<strong>输出:</strong>[1]
41+
</pre>
2542

26-
<p><strong>拓展声明:</strong><br>
27-
&nbsp;&ldquo;锯齿&rdquo; 顺序对于&nbsp;<code>k &gt; 2</code>&nbsp;的情况定义可能会有些歧义。所以,假如你觉得 &ldquo;锯齿&rdquo; 这个表述不妥,也可以认为这是一种&nbsp;&ldquo;循环&rdquo;。例如:</p>
43+
<p><strong>拓展:</strong>假如给你&nbsp;<code>k</code>&nbsp;个向量呢?你的代码在这种情况下的扩展性又会如何呢?</p>
2844

29-
<pre><strong>输入:</strong>
30-
[1,2,3]
31-
[4,5,6,7]
32-
[8,9]
45+
<p><strong>拓展声明:</strong><br />
46+
&nbsp;“锯齿” 顺序对于&nbsp;<code>k &gt; 2</code>&nbsp;的情况定义可能会有些歧义。所以,假如你觉得 “锯齿” 这个表述不妥,也可以认为这是一种&nbsp;“循环”。例如:</p>
3347

34-
<strong>输出: </strong><code>[1,4,8,2,5,9,3,6,7]</code>.
48+
<pre>
49+
<strong>输入:</strong>v1 = [1,2,3], v2 = [4,5,6,7], v3 = [8,9]
50+
<strong>输出:</strong>[1,4,8,2,5,9,3,6,7]
3551
</pre>
3652

3753
## 解法

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0600-0699/0642.Design%20Search%20Autocomplete%20System/README_EN.md)
44

5-
<!-- tags:设计,字典树,字符串,数据流 -->
5+
<!-- tags:设计,字典树,字符串,数据流,排序,堆(优先队列) -->
66

77
## 题目描述
88

Diff for: solution/0600-0699/0642.Design Search Autocomplete System/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0600-0699/0642.Design%20Search%20Autocomplete%20System/README.md)
44

5-
<!-- tags:Design,Trie,String,Data Stream -->
5+
<!-- tags:Design,Trie,String,Data Stream,Sorting,Heap (Priority Queue) -->
66

77
## Description
88

Diff for: solution/0600-0699/0647.Palindromic Substrings/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0600-0699/0647.Palindromic%20Substrings/README_EN.md)
44

5-
<!-- tags:字符串,动态规划 -->
5+
<!-- tags:双指针,字符串,动态规划 -->
66

77
## 题目描述
88

Diff for: solution/0600-0699/0647.Palindromic Substrings/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0600-0699/0647.Palindromic%20Substrings/README.md)
44

5-
<!-- tags:String,Dynamic Programming -->
5+
<!-- tags:Two Pointers,String,Dynamic Programming -->
66

77
## Description
88

Diff for: solution/0900-0999/0924.Minimize Malware Spread/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0900-0999/0924.Minimize%20Malware%20Spread/README_EN.md)
44

5-
<!-- tags:深度优先搜索,广度优先搜索,并查集,图,哈希表 -->
5+
<!-- tags:深度优先搜索,广度优先搜索,并查集,图,数组,哈希表 -->
66

77
## 题目描述
88

Diff for: solution/0900-0999/0924.Minimize Malware Spread/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0900-0999/0924.Minimize%20Malware%20Spread/README.md)
44

5-
<!-- tags:Depth-First Search,Breadth-First Search,Union Find,Graph,Hash Table -->
5+
<!-- tags:Depth-First Search,Breadth-First Search,Union Find,Graph,Array,Hash Table -->
66

77
## Description
88

Diff for: solution/0900-0999/0928.Minimize Malware Spread II/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0900-0999/0928.Minimize%20Malware%20Spread%20II/README_EN.md)
44

5-
<!-- tags:深度优先搜索,广度优先搜索,并查集,图,哈希表 -->
5+
<!-- tags:深度优先搜索,广度优先搜索,并查集,图,数组,哈希表 -->
66

77
## 题目描述
88

Diff for: solution/0900-0999/0928.Minimize Malware Spread II/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0900-0999/0928.Minimize%20Malware%20Spread%20II/README.md)
44

5-
<!-- tags:Depth-First Search,Breadth-First Search,Union Find,Graph,Hash Table -->
5+
<!-- tags:Depth-First Search,Breadth-First Search,Union Find,Graph,Array,Hash Table -->
66

77
## Description
88

Diff for: solution/1800-1899/1840.Maximum Building Height/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/1800-1899/1840.Maximum%20Building%20Height/README_EN.md)
44

5-
<!-- tags:数组,数学 -->
5+
<!-- tags:数组,数学,排序 -->
66

77
## 题目描述
88

Diff for: solution/1800-1899/1840.Maximum Building Height/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/1800-1899/1840.Maximum%20Building%20Height/README.md)
44

5-
<!-- tags:Array,Math -->
5+
<!-- tags:Array,Math,Sorting -->
66

77
## Description
88

Diff for: solution/2500-2599/2517.Maximum Tastiness of Candy Basket/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/2500-2599/2517.Maximum%20Tastiness%20of%20Candy%20Basket/README_EN.md)
44

5-
<!-- tags:数组,二分查找,排序 -->
5+
<!-- tags:贪心,数组,二分查找,排序 -->
66

77
## 题目描述
88

Diff for: solution/2500-2599/2517.Maximum Tastiness of Candy Basket/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/2500-2599/2517.Maximum%20Tastiness%20of%20Candy%20Basket/README.md)
44

5-
<!-- tags:Array,Binary Search,Sorting -->
5+
<!-- tags:Greedy,Array,Binary Search,Sorting -->
66

77
## Description
88

Diff for: solution/2600-2699/2639.Find the Width of Columns of a Grid/README.md

-12
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,4 @@ impl Solution {
147147

148148
<!-- tabs:end -->
149149

150-
### 方法二
151-
152-
<!-- tabs:start -->
153-
154-
```python
155-
class Solution:
156-
def findColumnWidth(self, grid: List[List[int]]) -> List[int]:
157-
return [max(len(str(x)) for x in col) for col in zip(*grid)]
158-
```
159-
160-
<!-- tabs:end -->
161-
162150
<!-- end -->

Diff for: solution/2600-2699/2639.Find the Width of Columns of a Grid/README_EN.md

-12
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,4 @@ impl Solution {
145145

146146
<!-- tabs:end -->
147147

148-
### Solution 2
149-
150-
<!-- tabs:start -->
151-
152-
```python
153-
class Solution:
154-
def findColumnWidth(self, grid: List[List[int]]) -> List[int]:
155-
return [max(len(str(x)) for x in col) for col in zip(*grid)]
156-
```
157-
158-
<!-- tabs:end -->
159-
160148
<!-- end -->

Diff for: solution/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| 0002 | [两数相加](/solution/0000-0099/0002.Add%20Two%20Numbers/README.md) | `递归`,`链表`,`数学` | 中等 | |
1616
| 0003 | [无重复字符的最长子串](/solution/0000-0099/0003.Longest%20Substring%20Without%20Repeating%20Characters/README.md) | `哈希表`,`字符串`,`滑动窗口` | 中等 | |
1717
| 0004 | [寻找两个正序数组的中位数](/solution/0000-0099/0004.Median%20of%20Two%20Sorted%20Arrays/README.md) | `数组`,`二分查找`,`分治` | 困难 | |
18-
| 0005 | [最长回文子串](/solution/0000-0099/0005.Longest%20Palindromic%20Substring/README.md) | `字符串`,`动态规划` | 中等 | |
18+
| 0005 | [最长回文子串](/solution/0000-0099/0005.Longest%20Palindromic%20Substring/README.md) | `双指针`,`字符串`,`动态规划` | 中等 | |
1919
| 0006 | [Z 字形变换](/solution/0000-0099/0006.Zigzag%20Conversion/README.md) | `字符串` | 中等 | |
2020
| 0007 | [整数反转](/solution/0000-0099/0007.Reverse%20Integer/README.md) | `数学` | 中等 | |
2121
| 0008 | [字符串转换整数 (atoi)](/solution/0000-0099/0008.String%20to%20Integer%20%28atoi%29/README.md) | `字符串` | 中等 | |
@@ -652,12 +652,12 @@
652652
| 0639 | [解码方法 II](/solution/0600-0699/0639.Decode%20Ways%20II/README.md) | `字符串`,`动态规划` | 困难 | |
653653
| 0640 | [求解方程](/solution/0600-0699/0640.Solve%20the%20Equation/README.md) | `数学`,`字符串`,`模拟` | 中等 | |
654654
| 0641 | [设计循环双端队列](/solution/0600-0699/0641.Design%20Circular%20Deque/README.md) | `设计`,`队列`,`数组`,`链表` | 中等 | |
655-
| 0642 | [设计搜索自动补全系统](/solution/0600-0699/0642.Design%20Search%20Autocomplete%20System/README.md) | `设计`,`字典树`,`字符串`,`数据流` | 困难 | 🔒 |
655+
| 0642 | [设计搜索自动补全系统](/solution/0600-0699/0642.Design%20Search%20Autocomplete%20System/README.md) | `设计`,`字典树`,`字符串`,`数据流`,`排序`,`堆(优先队列)` | 困难 | 🔒 |
656656
| 0643 | [子数组最大平均数 I](/solution/0600-0699/0643.Maximum%20Average%20Subarray%20I/README.md) | `数组`,`滑动窗口` | 简单 | |
657657
| 0644 | [子数组最大平均数 II](/solution/0600-0699/0644.Maximum%20Average%20Subarray%20II/README.md) | `数组`,`二分查找`,`前缀和` | 困难 | 🔒 |
658658
| 0645 | [错误的集合](/solution/0600-0699/0645.Set%20Mismatch/README.md) | `位运算`,`数组`,`哈希表`,`排序` | 简单 | |
659659
| 0646 | [最长数对链](/solution/0600-0699/0646.Maximum%20Length%20of%20Pair%20Chain/README.md) | `贪心`,`数组`,`动态规划`,`排序` | 中等 | |
660-
| 0647 | [回文子串](/solution/0600-0699/0647.Palindromic%20Substrings/README.md) | `字符串`,`动态规划` | 中等 | |
660+
| 0647 | [回文子串](/solution/0600-0699/0647.Palindromic%20Substrings/README.md) | `双指针`,`字符串`,`动态规划` | 中等 | |
661661
| 0648 | [单词替换](/solution/0600-0699/0648.Replace%20Words/README.md) | `字典树`,`数组`,`哈希表`,`字符串` | 中等 | |
662662
| 0649 | [Dota2 参议院](/solution/0600-0699/0649.Dota2%20Senate/README.md) | `贪心`,`队列`,`字符串` | 中等 | |
663663
| 0650 | [两个键的键盘](/solution/0600-0699/0650.2%20Keys%20Keyboard/README.md) | `数学`,`动态规划` | 中等 | |
@@ -934,11 +934,11 @@
934934
| 0921 | [使括号有效的最少添加](/solution/0900-0999/0921.Minimum%20Add%20to%20Make%20Parentheses%20Valid/README.md) | `栈`,`贪心`,`字符串` | 中等 | 第 106 场周赛 |
935935
| 0922 | [按奇偶排序数组 II](/solution/0900-0999/0922.Sort%20Array%20By%20Parity%20II/README.md) | `数组`,`双指针`,`排序` | 简单 | 第 106 场周赛 |
936936
| 0923 | [三数之和的多种可能](/solution/0900-0999/0923.3Sum%20With%20Multiplicity/README.md) | `数组`,`哈希表`,`双指针`,`计数`,`排序` | 中等 | 第 106 场周赛 |
937-
| 0924 | [尽量减少恶意软件的传播](/solution/0900-0999/0924.Minimize%20Malware%20Spread/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图`,`哈希表` | 困难 | 第 106 场周赛 |
937+
| 0924 | [尽量减少恶意软件的传播](/solution/0900-0999/0924.Minimize%20Malware%20Spread/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图`,`数组`,`哈希表` | 困难 | 第 106 场周赛 |
938938
| 0925 | [长按键入](/solution/0900-0999/0925.Long%20Pressed%20Name/README.md) | `双指针`,`字符串` | 简单 | 第 107 场周赛 |
939939
| 0926 | [将字符串翻转到单调递增](/solution/0900-0999/0926.Flip%20String%20to%20Monotone%20Increasing/README.md) | `字符串`,`动态规划` | 中等 | 第 107 场周赛 |
940940
| 0927 | [三等分](/solution/0900-0999/0927.Three%20Equal%20Parts/README.md) | `数组`,`数学` | 困难 | 第 107 场周赛 |
941-
| 0928 | [尽量减少恶意软件的传播 II](/solution/0900-0999/0928.Minimize%20Malware%20Spread%20II/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图`,`哈希表` | 困难 | 第 107 场周赛 |
941+
| 0928 | [尽量减少恶意软件的传播 II](/solution/0900-0999/0928.Minimize%20Malware%20Spread%20II/README.md) | `深度优先搜索`,`广度优先搜索`,`并查集`,`图`,`数组`,`哈希表` | 困难 | 第 107 场周赛 |
942942
| 0929 | [独特的电子邮件地址](/solution/0900-0999/0929.Unique%20Email%20Addresses/README.md) | `数组`,`哈希表`,`字符串` | 简单 | 第 108 场周赛 |
943943
| 0930 | [和相同的二元子数组](/solution/0900-0999/0930.Binary%20Subarrays%20With%20Sum/README.md) | `数组`,`哈希表`,`前缀和`,`滑动窗口` | 中等 | 第 108 场周赛 |
944944
| 0931 | [下降路径最小和](/solution/0900-0999/0931.Minimum%20Falling%20Path%20Sum/README.md) | `数组`,`动态规划`,`矩阵` | 中等 | 第 108 场周赛 |
@@ -1850,7 +1850,7 @@
18501850
| 1837 | [K 进制表示下的各位数字总和](/solution/1800-1899/1837.Sum%20of%20Digits%20in%20Base%20K/README.md) | `数学` | 简单 | 第 238 场周赛 |
18511851
| 1838 | [最高频元素的频数](/solution/1800-1899/1838.Frequency%20of%20the%20Most%20Frequent%20Element/README.md) | `贪心`,`数组`,`二分查找`,`前缀和`,`排序`,`滑动窗口` | 中等 | 第 238 场周赛 |
18521852
| 1839 | [所有元音按顺序排布的最长子字符串](/solution/1800-1899/1839.Longest%20Substring%20Of%20All%20Vowels%20in%20Order/README.md) | `字符串`,`滑动窗口` | 中等 | 第 238 场周赛 |
1853-
| 1840 | [最高建筑高度](/solution/1800-1899/1840.Maximum%20Building%20Height/README.md) | `数组`,`数学` | 困难 | 第 238 场周赛 |
1853+
| 1840 | [最高建筑高度](/solution/1800-1899/1840.Maximum%20Building%20Height/README.md) | `数组`,`数学`,`排序` | 困难 | 第 238 场周赛 |
18541854
| 1841 | [联赛信息统计](/solution/1800-1899/1841.League%20Statistics/README.md) | `数据库` | 中等 | 🔒 |
18551855
| 1842 | [下个由相同数字构成的回文串](/solution/1800-1899/1842.Next%20Palindrome%20Using%20Same%20Digits/README.md) | `双指针`,`字符串` | 困难 | 🔒 |
18561856
| 1843 | [可疑银行账户](/solution/1800-1899/1843.Suspicious%20Bank%20Accounts/README.md) | `数据库` | 中等 | 🔒 |
@@ -2527,7 +2527,7 @@
25272527
| 2514 | [统计同位异构字符串数目](/solution/2500-2599/2514.Count%20Anagrams/README.md) | `哈希表`,`数学`,`字符串`,`组合数学`,`计数` | 困难 | 第 94 场双周赛 |
25282528
| 2515 | [到目标字符串的最短距离](/solution/2500-2599/2515.Shortest%20Distance%20to%20Target%20String%20in%20a%20Circular%20Array/README.md) | `数组`,`字符串` | 简单 | 第 325 场周赛 |
25292529
| 2516 | [每种字符至少取 K 个](/solution/2500-2599/2516.Take%20K%20of%20Each%20Character%20From%20Left%20and%20Right/README.md) | `哈希表`,`字符串`,`滑动窗口` | 中等 | 第 325 场周赛 |
2530-
| 2517 | [礼盒的最大甜蜜度](/solution/2500-2599/2517.Maximum%20Tastiness%20of%20Candy%20Basket/README.md) | `数组`,`二分查找`,`排序` | 中等 | 第 325 场周赛 |
2530+
| 2517 | [礼盒的最大甜蜜度](/solution/2500-2599/2517.Maximum%20Tastiness%20of%20Candy%20Basket/README.md) | `贪心`,`数组`,`二分查找`,`排序` | 中等 | 第 325 场周赛 |
25312531
| 2518 | [好分区的数目](/solution/2500-2599/2518.Number%20of%20Great%20Partitions/README.md) | `数组`,`动态规划` | 困难 | 第 325 场周赛 |
25322532
| 2519 | [统计 K-Big 索引的数量](/solution/2500-2599/2519.Count%20the%20Number%20of%20K-Big%20Indices/README.md) | `树状数组`,`线段树`,`数组`,`二分查找`,`分治`,`有序集合`,`归并排序` | 困难 | 🔒 |
25332533
| 2520 | [统计能整除数字的位数](/solution/2500-2599/2520.Count%20the%20Digits%20That%20Divide%20a%20Number/README.md) | `数学` | 简单 | 第 326 场周赛 |

0 commit comments

Comments
 (0)