Skip to content

Commit c2b7232

Browse files
authored
feat: update lc problems (doocs#2654)
1 parent 72536f4 commit c2b7232

File tree

22 files changed

+40
-40
lines changed

22 files changed

+40
-40
lines changed

solution/0000-0099/0043.Multiply Strings/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ class Solution {
288288
$product[$i + $j] += $carry;
289289
}
290290
}
291-
$result = implode("", $product);
291+
$result = implode('', $product);
292292
$result = ltrim($result, '0');
293-
return $result === "" ? "0" : $result;
293+
return $result === '' ? '0' : $result;
294294
}
295295
}
296296
```

solution/0000-0099/0043.Multiply Strings/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ class Solution {
279279
$product[$i + $j] += $carry;
280280
}
281281
}
282-
$result = implode("", $product);
282+
$result = implode('', $product);
283283
$result = ltrim($result, '0');
284-
return $result === "" ? "0" : $result;
284+
return $result === '' ? '0' : $result;
285285
}
286286
}
287287
```

solution/0000-0099/0043.Multiply Strings/Solution.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function multiply($num1, $num2) {
2222
$product[$i + $j] += $carry;
2323
}
2424
}
25-
$result = implode("", $product);
25+
$result = implode('', $product);
2626
$result = ltrim($result, '0');
27-
return $result === "" ? "0" : $result;
27+
return $result === '' ? '0' : $result;
2828
}
29-
}
29+
}

solution/0000-0099/0044.Wildcard Matching/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ class Solution {
411411
function isMatch($s, $p) {
412412
$lengthS = strlen($s);
413413
$lengthP = strlen($p);
414-
$dp = array();
414+
$dp = [];
415415
for ($i = 0; $i <= $lengthS; $i++) {
416416
$dp[$i] = array_fill(0, $lengthP + 1, false);
417417
}
@@ -426,7 +426,7 @@ class Solution {
426426
for ($j = 1; $j <= $lengthP; $j++) {
427427
if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) {
428428
$dp[$i][$j] = $dp[$i - 1][$j - 1];
429-
} else if ($p[$j - 1] == '*') {
429+
} elseif ($p[$j - 1] == '*') {
430430
$dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j];
431431
}
432432
}

solution/0000-0099/0044.Wildcard Matching/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class Solution {
404404
function isMatch($s, $p) {
405405
$lengthS = strlen($s);
406406
$lengthP = strlen($p);
407-
$dp = array();
407+
$dp = [];
408408
for ($i = 0; $i <= $lengthS; $i++) {
409409
$dp[$i] = array_fill(0, $lengthP + 1, false);
410410
}
@@ -419,7 +419,7 @@ class Solution {
419419
for ($j = 1; $j <= $lengthP; $j++) {
420420
if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) {
421421
$dp[$i][$j] = $dp[$i - 1][$j - 1];
422-
} else if ($p[$j - 1] == '*') {
422+
} elseif ($p[$j - 1] == '*') {
423423
$dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j];
424424
}
425425
}

solution/0000-0099/0044.Wildcard Matching/Solution.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Solution {
88
function isMatch($s, $p) {
99
$lengthS = strlen($s);
1010
$lengthP = strlen($p);
11-
$dp = array();
11+
$dp = [];
1212
for ($i = 0; $i <= $lengthS; $i++) {
1313
$dp[$i] = array_fill(0, $lengthP + 1, false);
1414
}
@@ -23,11 +23,11 @@ function isMatch($s, $p) {
2323
for ($j = 1; $j <= $lengthP; $j++) {
2424
if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) {
2525
$dp[$i][$j] = $dp[$i - 1][$j - 1];
26-
} else if ($p[$j - 1] == '*') {
26+
} elseif ($p[$j - 1] == '*') {
2727
$dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j];
2828
}
2929
}
3030
}
3131
return $dp[$lengthS][$lengthP];
3232
}
33-
}
33+
}

solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README.md

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

33
[English Version](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:贪心,字符串,排序 -->
66

77
## 题目描述
88

solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README_EN.md

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

33
[中文文档](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Greedy,String,Sorting -->
66

77
## Description
88

solution/3100-3199/3120.Count the Number of Special Characters I/README.md

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

33
[English Version](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:哈希表,字符串 -->
66

77
## 题目描述
88

solution/3100-3199/3120.Count the Number of Special Characters I/README_EN.md

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

33
[中文文档](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Hash Table,String -->
66

77
## Description
88

solution/3100-3199/3121.Count the Number of Special Characters II/README.md

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

33
[English Version](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:哈希表,字符串 -->
66

77
## 题目描述
88

solution/3100-3199/3121.Count the Number of Special Characters II/README_EN.md

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

33
[中文文档](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Hash Table,String -->
66

77
## Description
88

solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README.md

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

33
[English Version](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:数组,动态规划,矩阵 -->
66

77
## 题目描述
88

solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README_EN.md

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

33
[中文文档](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Array,Dynamic Programming,Matrix -->
66

77
## Description
88

solution/3100-3199/3123.Find Edges in Shortest Paths/README.md

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

33
[English Version](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:深度优先搜索,广度优先搜索,图,最短路,堆(优先队列) -->
66

77
## 题目描述
88

solution/3100-3199/3123.Find Edges in Shortest Paths/README_EN.md

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

33
[中文文档](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Depth-First Search,Breadth-First Search,Graph,Shortest Path,Heap (Priority Queue) -->
66

77
## Description
88

solution/3100-3199/3124.Find Longest Calls/README.md

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

33
[English Version](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md)
44

5-
<!-- tags: -->
5+
<!-- tags:数据库 -->
66

77
## 题目描述
88

solution/3100-3199/3124.Find Longest Calls/README_EN.md

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

33
[中文文档](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md)
44

5-
<!-- tags: -->
5+
<!-- tags:Database -->
66

77
## Description
88

solution/DATABASE_README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
| 3089 | [查找突发行为](/solution/3000-3099/3089.Find%20Bursty%20Behavior/README.md) | `数据库` | 中等 | 🔒 |
276276
| 3103 | [查找热门话题标签 II](/solution/3100-3199/3103.Find%20Trending%20Hashtags%20II/README.md) | `数据库` | 困难 | 🔒 |
277277
| 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README.md) | `数据库` | 中等 | 🔒 |
278-
| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | | 中等 | 🔒 |
278+
| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | `数据库` | 中等 | 🔒 |
279279

280280
## 版权
281281

solution/DATABASE_README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
273273
| 3089 | [Find Bursty Behavior](/solution/3000-3099/3089.Find%20Bursty%20Behavior/README_EN.md) | `Database` | Medium | 🔒 |
274274
| 3103 | [Find Trending Hashtags II](/solution/3100-3199/3103.Find%20Trending%20Hashtags%20II/README_EN.md) | `Database` | Hard | 🔒 |
275275
| 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README_EN.md) | `Database` | Medium | 🔒 |
276-
| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | | Medium | 🔒 |
276+
| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | `Database` | Medium | 🔒 |
277277

278278
## Copyright
279279

solution/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3129,12 +3129,12 @@
31293129
| 3116 | [单面值组合的第 K 小金额](/solution/3100-3199/3116.Kth%20Smallest%20Amount%20With%20Single%20Denomination%20Combination/README.md) | `位运算`,`数组`,`数学`,`二分查找`,`组合数学`,`数论` | 困难 | 第 393 场周赛 |
31303130
| 3117 | [划分数组得到最小的值之和](/solution/3100-3199/3117.Minimum%20Sum%20of%20Values%20by%20Dividing%20Array/README.md) | `位运算`,`线段树`,`队列`,`数组`,`二分查找`,`动态规划` | 困难 | 第 393 场周赛 |
31313131
| 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README.md) | `数据库` | 中等 | 🔒 |
3132-
| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md) | | 中等 | 🔒 |
3133-
| 3120 | [统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md) | | 简单 | 第 394 场周赛 |
3134-
| 3121 | [统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md) | | 中等 | 第 394 场周赛 |
3135-
| 3122 | [使矩阵满足条件的最少操作次数](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md) | | 中等 | 第 394 场周赛 |
3136-
| 3123 | [最短路径中的边](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md) | | 困难 | 第 394 场周赛 |
3137-
| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | | 中等 | 🔒 |
3132+
| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md) | `贪心`,`字符串`,`排序` | 中等 | 🔒 |
3133+
| 3120 | [统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md) | `哈希表`,`字符串` | 简单 | 第 394 场周赛 |
3134+
| 3121 | [统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md) | `哈希表`,`字符串` | 中等 | 第 394 场周赛 |
3135+
| 3122 | [使矩阵满足条件的最少操作次数](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md) | `数组`,`动态规划`,`矩阵` | 中等 | 第 394 场周赛 |
3136+
| 3123 | [最短路径中的边](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md) | `深度优先搜索`,`广度优先搜索`,`图`,`最短路`,`堆(优先队列)` | 困难 | 第 394 场周赛 |
3137+
| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | `数据库` | 中等 | 🔒 |
31383138

31393139
## 版权
31403140

solution/README_EN.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3127,12 +3127,12 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
31273127
| 3116 | [Kth Smallest Amount With Single Denomination Combination](/solution/3100-3199/3116.Kth%20Smallest%20Amount%20With%20Single%20Denomination%20Combination/README_EN.md) | `Bit Manipulation`,`Array`,`Math`,`Binary Search`,`Combinatorics`,`Number Theory` | Hard | Weekly Contest 393 |
31283128
| 3117 | [Minimum Sum of Values by Dividing Array](/solution/3100-3199/3117.Minimum%20Sum%20of%20Values%20by%20Dividing%20Array/README_EN.md) | `Bit Manipulation`,`Segment Tree`,`Queue`,`Array`,`Binary Search`,`Dynamic Programming` | Hard | Weekly Contest 393 |
31293129
| 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README_EN.md) | `Database` | Medium | 🔒 |
3130-
| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README_EN.md) | | Medium | 🔒 |
3131-
| 3120 | [Count the Number of Special Characters I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README_EN.md) | | Easy | Weekly Contest 394 |
3132-
| 3121 | [Count the Number of Special Characters II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README_EN.md) | | Medium | Weekly Contest 394 |
3133-
| 3122 | [Minimum Number of Operations to Satisfy Conditions](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README_EN.md) | | Medium | Weekly Contest 394 |
3134-
| 3123 | [Find Edges in Shortest Paths](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README_EN.md) | | Hard | Weekly Contest 394 |
3135-
| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | | Medium | 🔒 |
3130+
| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README_EN.md) | `Greedy`,`String`,`Sorting` | Medium | 🔒 |
3131+
| 3120 | [Count the Number of Special Characters I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README_EN.md) | `Hash Table`,`String` | Easy | Weekly Contest 394 |
3132+
| 3121 | [Count the Number of Special Characters II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README_EN.md) | `Hash Table`,`String` | Medium | Weekly Contest 394 |
3133+
| 3122 | [Minimum Number of Operations to Satisfy Conditions](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README_EN.md) | `Array`,`Dynamic Programming`,`Matrix` | Medium | Weekly Contest 394 |
3134+
| 3123 | [Find Edges in Shortest Paths](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Graph`,`Shortest Path`,`Heap (Priority Queue)` | Hard | Weekly Contest 394 |
3135+
| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | `Database` | Medium | 🔒 |
31363136

31373137
## Copyright
31383138

0 commit comments

Comments
 (0)