diff --git a/solution/0000-0099/0043.Multiply Strings/README.md b/solution/0000-0099/0043.Multiply Strings/README.md index 86eb445be2dc4..28d06ec79c21b 100644 --- a/solution/0000-0099/0043.Multiply Strings/README.md +++ b/solution/0000-0099/0043.Multiply Strings/README.md @@ -288,9 +288,9 @@ class Solution { $product[$i + $j] += $carry; } } - $result = implode("", $product); + $result = implode('', $product); $result = ltrim($result, '0'); - return $result === "" ? "0" : $result; + return $result === '' ? '0' : $result; } } ``` diff --git a/solution/0000-0099/0043.Multiply Strings/README_EN.md b/solution/0000-0099/0043.Multiply Strings/README_EN.md index 18bd2317bf40d..f5c083b96a6e3 100644 --- a/solution/0000-0099/0043.Multiply Strings/README_EN.md +++ b/solution/0000-0099/0043.Multiply Strings/README_EN.md @@ -279,9 +279,9 @@ class Solution { $product[$i + $j] += $carry; } } - $result = implode("", $product); + $result = implode('', $product); $result = ltrim($result, '0'); - return $result === "" ? "0" : $result; + return $result === '' ? '0' : $result; } } ``` diff --git a/solution/0000-0099/0043.Multiply Strings/Solution.php b/solution/0000-0099/0043.Multiply Strings/Solution.php index 3ff438105d7e4..ff491e75cb7ef 100644 --- a/solution/0000-0099/0043.Multiply Strings/Solution.php +++ b/solution/0000-0099/0043.Multiply Strings/Solution.php @@ -22,8 +22,8 @@ function multiply($num1, $num2) { $product[$i + $j] += $carry; } } - $result = implode("", $product); + $result = implode('', $product); $result = ltrim($result, '0'); - return $result === "" ? "0" : $result; + return $result === '' ? '0' : $result; } -} +} \ No newline at end of file diff --git a/solution/0000-0099/0044.Wildcard Matching/README.md b/solution/0000-0099/0044.Wildcard Matching/README.md index 9a5068b5579c3..d40b5eb9b60e5 100644 --- a/solution/0000-0099/0044.Wildcard Matching/README.md +++ b/solution/0000-0099/0044.Wildcard Matching/README.md @@ -411,7 +411,7 @@ class Solution { function isMatch($s, $p) { $lengthS = strlen($s); $lengthP = strlen($p); - $dp = array(); + $dp = []; for ($i = 0; $i <= $lengthS; $i++) { $dp[$i] = array_fill(0, $lengthP + 1, false); } @@ -426,7 +426,7 @@ class Solution { for ($j = 1; $j <= $lengthP; $j++) { if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) { $dp[$i][$j] = $dp[$i - 1][$j - 1]; - } else if ($p[$j - 1] == '*') { + } elseif ($p[$j - 1] == '*') { $dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j]; } } diff --git a/solution/0000-0099/0044.Wildcard Matching/README_EN.md b/solution/0000-0099/0044.Wildcard Matching/README_EN.md index 0affc9936fa44..c138ccbdfc09e 100644 --- a/solution/0000-0099/0044.Wildcard Matching/README_EN.md +++ b/solution/0000-0099/0044.Wildcard Matching/README_EN.md @@ -404,7 +404,7 @@ class Solution { function isMatch($s, $p) { $lengthS = strlen($s); $lengthP = strlen($p); - $dp = array(); + $dp = []; for ($i = 0; $i <= $lengthS; $i++) { $dp[$i] = array_fill(0, $lengthP + 1, false); } @@ -419,7 +419,7 @@ class Solution { for ($j = 1; $j <= $lengthP; $j++) { if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) { $dp[$i][$j] = $dp[$i - 1][$j - 1]; - } else if ($p[$j - 1] == '*') { + } elseif ($p[$j - 1] == '*') { $dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j]; } } diff --git a/solution/0000-0099/0044.Wildcard Matching/Solution.php b/solution/0000-0099/0044.Wildcard Matching/Solution.php index a6ee3e8bd7922..9f15010209d57 100644 --- a/solution/0000-0099/0044.Wildcard Matching/Solution.php +++ b/solution/0000-0099/0044.Wildcard Matching/Solution.php @@ -8,7 +8,7 @@ class Solution { function isMatch($s, $p) { $lengthS = strlen($s); $lengthP = strlen($p); - $dp = array(); + $dp = []; for ($i = 0; $i <= $lengthS; $i++) { $dp[$i] = array_fill(0, $lengthP + 1, false); } @@ -23,11 +23,11 @@ function isMatch($s, $p) { for ($j = 1; $j <= $lengthP; $j++) { if ($p[$j - 1] == '?' || $s[$i - 1] == $p[$j - 1]) { $dp[$i][$j] = $dp[$i - 1][$j - 1]; - } else if ($p[$j - 1] == '*') { + } elseif ($p[$j - 1] == '*') { $dp[$i][$j] = $dp[$i][$j - 1] || $dp[$i - 1][$j]; } } } return $dp[$lengthS][$lengthP]; } -} +} \ No newline at end of file diff --git a/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README.md b/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README.md index 980fa3b136792..ad93927aa2332 100644 --- a/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README.md +++ b/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README_EN.md b/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README_EN.md index 16a5a6526d284..845b4fa43becd 100644 --- a/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README_EN.md +++ b/solution/3100-3199/3119.Maximum Number of Potholes That Can Be Fixed/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md) - + ## Description diff --git a/solution/3100-3199/3120.Count the Number of Special Characters I/README.md b/solution/3100-3199/3120.Count the Number of Special Characters I/README.md index 4d032fffaf589..58a2c0536b454 100644 --- a/solution/3100-3199/3120.Count the Number of Special Characters I/README.md +++ b/solution/3100-3199/3120.Count the Number of Special Characters I/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3120.Count the Number of Special Characters I/README_EN.md b/solution/3100-3199/3120.Count the Number of Special Characters I/README_EN.md index fd27ce027d7f7..65c49c8af8e11 100644 --- a/solution/3100-3199/3120.Count the Number of Special Characters I/README_EN.md +++ b/solution/3100-3199/3120.Count the Number of Special Characters I/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md) - + ## Description diff --git a/solution/3100-3199/3121.Count the Number of Special Characters II/README.md b/solution/3100-3199/3121.Count the Number of Special Characters II/README.md index 40f6392166526..6348b65205f7f 100644 --- a/solution/3100-3199/3121.Count the Number of Special Characters II/README.md +++ b/solution/3100-3199/3121.Count the Number of Special Characters II/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3121.Count the Number of Special Characters II/README_EN.md b/solution/3100-3199/3121.Count the Number of Special Characters II/README_EN.md index b96724d3ea94b..bb6dafc0d4986 100644 --- a/solution/3100-3199/3121.Count the Number of Special Characters II/README_EN.md +++ b/solution/3100-3199/3121.Count the Number of Special Characters II/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md) - + ## Description diff --git a/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README.md b/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README.md index 6dfc3c77d0a15..b91215c190968 100644 --- a/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README.md +++ b/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README_EN.md b/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README_EN.md index 7e99715779d28..f6e28d7185dec 100644 --- a/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README_EN.md +++ b/solution/3100-3199/3122.Minimum Number of Operations to Satisfy Conditions/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md) - + ## Description diff --git a/solution/3100-3199/3123.Find Edges in Shortest Paths/README.md b/solution/3100-3199/3123.Find Edges in Shortest Paths/README.md index 6f1751c3e46f5..202c5b46afdf9 100644 --- a/solution/3100-3199/3123.Find Edges in Shortest Paths/README.md +++ b/solution/3100-3199/3123.Find Edges in Shortest Paths/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3123.Find Edges in Shortest Paths/README_EN.md b/solution/3100-3199/3123.Find Edges in Shortest Paths/README_EN.md index ac16b61d74df5..2fd8c63dce9af 100644 --- a/solution/3100-3199/3123.Find Edges in Shortest Paths/README_EN.md +++ b/solution/3100-3199/3123.Find Edges in Shortest Paths/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md) - + ## Description diff --git a/solution/3100-3199/3124.Find Longest Calls/README.md b/solution/3100-3199/3124.Find Longest Calls/README.md index dcce35d24b721..402b0d613ee36 100644 --- a/solution/3100-3199/3124.Find Longest Calls/README.md +++ b/solution/3100-3199/3124.Find Longest Calls/README.md @@ -2,7 +2,7 @@ [English Version](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) - + ## 题目描述 diff --git a/solution/3100-3199/3124.Find Longest Calls/README_EN.md b/solution/3100-3199/3124.Find Longest Calls/README_EN.md index 25b6093d54b49..e7837bea00098 100644 --- a/solution/3100-3199/3124.Find Longest Calls/README_EN.md +++ b/solution/3100-3199/3124.Find Longest Calls/README_EN.md @@ -2,7 +2,7 @@ [中文文档](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) - + ## Description diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index 44fac374e6a1f..fc62a6c1672bc 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -275,7 +275,7 @@ | 3089 | [查找突发行为](/solution/3000-3099/3089.Find%20Bursty%20Behavior/README.md) | `数据库` | 中等 | 🔒 | | 3103 | [查找热门话题标签 II](/solution/3100-3199/3103.Find%20Trending%20Hashtags%20II/README.md) | `数据库` | 困难 | 🔒 | | 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README.md) | `数据库` | 中等 | 🔒 | -| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | | 中等 | 🔒 | +| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | `数据库` | 中等 | 🔒 | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index 994d2e12f3839..aa3ce4d9ccf4f 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -273,7 +273,7 @@ Press Control + F(or Command + F on | 3089 | [Find Bursty Behavior](/solution/3000-3099/3089.Find%20Bursty%20Behavior/README_EN.md) | `Database` | Medium | 🔒 | | 3103 | [Find Trending Hashtags II](/solution/3100-3199/3103.Find%20Trending%20Hashtags%20II/README_EN.md) | `Database` | Hard | 🔒 | | 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README_EN.md) | `Database` | Medium | 🔒 | -| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | | Medium | 🔒 | +| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | `Database` | Medium | 🔒 | ## Copyright diff --git a/solution/README.md b/solution/README.md index bdd60967bb53e..661cc824008d0 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3129,12 +3129,12 @@ | 3116 | [单面值组合的第 K 小金额](/solution/3100-3199/3116.Kth%20Smallest%20Amount%20With%20Single%20Denomination%20Combination/README.md) | `位运算`,`数组`,`数学`,`二分查找`,`组合数学`,`数论` | 困难 | 第 393 场周赛 | | 3117 | [划分数组得到最小的值之和](/solution/3100-3199/3117.Minimum%20Sum%20of%20Values%20by%20Dividing%20Array/README.md) | `位运算`,`线段树`,`队列`,`数组`,`二分查找`,`动态规划` | 困难 | 第 393 场周赛 | | 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README.md) | `数据库` | 中等 | 🔒 | -| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md) | | 中等 | 🔒 | -| 3120 | [统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md) | | 简单 | 第 394 场周赛 | -| 3121 | [统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md) | | 中等 | 第 394 场周赛 | -| 3122 | [使矩阵满足条件的最少操作次数](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md) | | 中等 | 第 394 场周赛 | -| 3123 | [最短路径中的边](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md) | | 困难 | 第 394 场周赛 | -| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | | 中等 | 🔒 | +| 3119 | [Maximum Number of Potholes That Can Be Fixed](/solution/3100-3199/3119.Maximum%20Number%20of%20Potholes%20That%20Can%20Be%20Fixed/README.md) | `贪心`,`字符串`,`排序` | 中等 | 🔒 | +| 3120 | [统计特殊字母的数量 I](/solution/3100-3199/3120.Count%20the%20Number%20of%20Special%20Characters%20I/README.md) | `哈希表`,`字符串` | 简单 | 第 394 场周赛 | +| 3121 | [统计特殊字母的数量 II](/solution/3100-3199/3121.Count%20the%20Number%20of%20Special%20Characters%20II/README.md) | `哈希表`,`字符串` | 中等 | 第 394 场周赛 | +| 3122 | [使矩阵满足条件的最少操作次数](/solution/3100-3199/3122.Minimum%20Number%20of%20Operations%20to%20Satisfy%20Conditions/README.md) | `数组`,`动态规划`,`矩阵` | 中等 | 第 394 场周赛 | +| 3123 | [最短路径中的边](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README.md) | `深度优先搜索`,`广度优先搜索`,`图`,`最短路`,`堆(优先队列)` | 困难 | 第 394 场周赛 | +| 3124 | [查找最长的电话](/solution/3100-3199/3124.Find%20Longest%20Calls/README.md) | `数据库` | 中等 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 0e19e8af91feb..0a38e14532380 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3127,12 +3127,12 @@ Press Control + F(or Command + F on | 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 | | 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 | | 3118 | [Friday Purchase III](/solution/3100-3199/3118.Friday%20Purchase%20III/README_EN.md) | `Database` | Medium | 🔒 | -| 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 | 🔒 | -| 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 | -| 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 | -| 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 | -| 3123 | [Find Edges in Shortest Paths](/solution/3100-3199/3123.Find%20Edges%20in%20Shortest%20Paths/README_EN.md) | | Hard | Weekly Contest 394 | -| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | | Medium | 🔒 | +| 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 | 🔒 | +| 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 | +| 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 | +| 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 | +| 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 | +| 3124 | [Find Longest Calls](/solution/3100-3199/3124.Find%20Longest%20Calls/README_EN.md) | `Database` | Medium | 🔒 | ## Copyright