Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update lc problems #2654

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions solution/0000-0099/0043.Multiply Strings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions solution/0000-0099/0043.Multiply Strings/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions solution/0000-0099/0043.Multiply Strings/Solution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
4 changes: 2 additions & 2 deletions solution/0000-0099/0044.Wildcard Matching/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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];
}
}
Expand Down
4 changes: 2 additions & 2 deletions solution/0000-0099/0044.Wildcard Matching/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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];
}
}
Expand Down
6 changes: 3 additions & 3 deletions solution/0000-0099/0044.Wildcard Matching/Solution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## 题目描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:Greedy,String,Sorting -->

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## 题目描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:Hash Table,String -->

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## 题目描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:Hash Table,String -->

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## 题目描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:Array,Dynamic Programming,Matrix -->

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## 题目描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## Description

Expand Down
2 changes: 1 addition & 1 deletion solution/3100-3199/3124.Find Longest Calls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:数据库 -->

## 题目描述

Expand Down
2 changes: 1 addition & 1 deletion solution/3100-3199/3124.Find Longest Calls/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<!-- tags: -->
<!-- tags:Database -->

## Description

Expand Down
2 changes: 1 addition & 1 deletion solution/DATABASE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | `数据库` | 中等 | 🔒 |

## 版权

Expand Down
2 changes: 1 addition & 1 deletion solution/DATABASE_README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> 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

Expand Down
12 changes: 6 additions & 6 deletions solution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | `数据库` | 中等 | 🔒 |

## 版权

Expand Down
12 changes: 6 additions & 6 deletions solution/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3127,12 +3127,12 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> 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

Expand Down
Loading