diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md index 361728caaea79..30c5a25b9f808 100644 --- a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md +++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md @@ -211,6 +211,31 @@ var searchRange = function (nums, target) { }; ``` +#### C# + +```cs +public class Solution { + public int[] SearchRange(int[] nums, int target) { + int l = Search(nums, target); + int r = Search(nums, target + 1); + return l == r ? new int[] {-1, -1} : new int[] {l, r - 1}; + } + + private int Search(int[] nums, int x) { + int left = 0, right = nums.Length; + while (left < right) { + int mid = (left + right) >>> 1; + if (nums[mid] >= x) { + right = mid; + } else { + left = mid + 1; + } + } + return left; + } +} +``` + #### PHP ```php diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md index 491b8072d5031..2458ddc9bbc57 100644 --- a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md +++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md @@ -201,6 +201,31 @@ var searchRange = function (nums, target) { }; ``` +#### C# + +```cs +public class Solution { + public int[] SearchRange(int[] nums, int target) { + int l = Search(nums, target); + int r = Search(nums, target + 1); + return l == r ? new int[] {-1, -1} : new int[] {l, r - 1}; + } + + private int Search(int[] nums, int x) { + int left = 0, right = nums.Length; + while (left < right) { + int mid = (left + right) >>> 1; + if (nums[mid] >= x) { + right = mid; + } else { + left = mid + 1; + } + } + return left; + } +} +``` + #### PHP ```php diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/Solution.cs b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/Solution.cs new file mode 100644 index 0000000000000..b934d4277e689 --- /dev/null +++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/Solution.cs @@ -0,0 +1,20 @@ +public class Solution { + public int[] SearchRange(int[] nums, int target) { + int l = Search(nums, target); + int r = Search(nums, target + 1); + return l == r ? new int[] {-1, -1} : new int[] {l, r - 1}; + } + + private int Search(int[] nums, int x) { + int left = 0, right = nums.Length; + while (left < right) { + int mid = (left + right) >>> 1; + if (nums[mid] >= x) { + right = mid; + } else { + left = mid + 1; + } + } + return left; + } +} \ No newline at end of file diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/README.md b/solution/0600-0699/0624.Maximum Distance in Arrays/README.md index e184709d06cd7..30f9b82ea0797 100644 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/README.md +++ b/solution/0600-0699/0624.Maximum Distance in Arrays/README.md @@ -62,11 +62,13 @@ tags: ### 方法一:维护最大值和最小值 -我们注意到,最大距离一定是两个数组中的一个最大值和另一个最小值之间的距离。因此,我们可以维护两个变量,分别表示当前数组中的最大值和最小值,然后遍历数组,更新最大距离,同时更新最大值和最小值。 +我们注意到,最大距离一定是两个数组中的一个最大值和另一个最小值之间的距离。因此,我们可以维护两个变量 $\textit{mi}$ 和 $\textit{mx}$,分别表示已经遍历过的数组中的最小值和最大值。初始时 $\textit{mi}$ 和 $\textit{mx}$ 分别为第一个数组的第一个元素和最后一个元素。 + +接下来,我们从第二个数组开始遍历,对于每个数组,我们首先计算当前数组的第一个元素和 $\textit{mx}$ 之间的距离,以及当前数组的最后一个元素和 $\textit{mi}$ 之间的距离,然后更新最大距离。同时,我们更新 $\textit{mi}$ 和 $\textit{mx}$ 为当前数组的第一个元素和最后一个元素。 遍历结束后,即可得到最大距离。 -时间复杂度 $O(m)$,空间复杂度 $O(1)$。其中 $m$ 为数组的个数。 +时间复杂度 $O(m)$,其中 $m$ 为数组的个数。空间复杂度 $O(1)$。 @@ -152,66 +154,42 @@ func abs(x int) int { ```ts function maxDistance(arrays: number[][]): number { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1)! - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)!); + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)!]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1)! - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)!); } - - return res; + return ans; } ``` -#### JavaScript +#### Rust -```js -/** - * @param {number[][]} arrays - * @return {number} - */ -var maxDistance = function (arrays) { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1) - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)); - } +```rust +impl Solution { + pub fn max_distance(arrays: Vec>) -> i32 { + let mut ans = 0; + let mut mi = arrays[0][0]; + let mut mx = arrays[0][arrays[0].len() - 1]; - return res; -}; -``` + for i in 1..arrays.len() { + let arr = &arrays[i]; + let a = (arr[0] - mx).abs(); + let b = (arr[arr.len() - 1] - mi).abs(); + ans = ans.max(a).max(b); - - - - - - -### 方法二:一行 - - - -#### TypeScript + mi = mi.min(arr[0]); + mx = mx.max(arr[arr.len() - 1]); + } -```ts -const maxDistance = (arrays: number[][]): number => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1)! - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)!), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; + ans + } +} ``` #### JavaScript @@ -221,15 +199,19 @@ const maxDistance = (arrays: number[][]): number => * @param {number[][]} arrays * @return {number} */ -var maxDistance = arrays => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1) - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; +var maxDistance = function (arrays) { + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1) - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)); + } + return ans; +}; ``` diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/README_EN.md b/solution/0600-0699/0624.Maximum Distance in Arrays/README_EN.md index d07ae857f88e1..b6c7a33b09bba 100644 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/README_EN.md +++ b/solution/0600-0699/0624.Maximum Distance in Arrays/README_EN.md @@ -57,7 +57,15 @@ tags: -### Solution 1 +### Solution 1: Maintain Maximum and Minimum Values + +We notice that the maximum distance must be the distance between the maximum value in one array and the minimum value in another array. Therefore, we can maintain two variables $\textit{mi}$ and $\textit{mx}$, representing the minimum and maximum values of the arrays we have traversed. Initially, $\textit{mi}$ and $\textit{mx}$ are the first and last elements of the first array, respectively. + +Next, we traverse from the second array. For each array, we first calculate the distance between the first element of the current array and $\textit{mx}$, and the distance between the last element of the current array and $\textit{mi}$. Then, we update the maximum distance. At the same time, we update $\textit{mi}$ and $\textit{mx}$ to be the first and last elements of the current array. + +After traversing all arrays, we get the maximum distance. + +The time complexity is $O(m)$, where $m$ is the number of arrays. The space complexity is $O(1)$. @@ -143,66 +151,42 @@ func abs(x int) int { ```ts function maxDistance(arrays: number[][]): number { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1)! - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)!); + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)!]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1)! - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)!); } - - return res; + return ans; } ``` -#### JavaScript - -```js -/** - * @param {number[][]} arrays - * @return {number} - */ -var maxDistance = function (arrays) { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1) - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)); - } - - return res; -}; -``` - - - - - - +#### Rust -### Solution 2: One-line solution +```rust +impl Solution { + pub fn max_distance(arrays: Vec>) -> i32 { + let mut ans = 0; + let mut mi = arrays[0][0]; + let mut mx = arrays[0][arrays[0].len() - 1]; - + for i in 1..arrays.len() { + let arr = &arrays[i]; + let a = (arr[0] - mx).abs(); + let b = (arr[arr.len() - 1] - mi).abs(); + ans = ans.max(a).max(b); -#### TypeScript + mi = mi.min(arr[0]); + mx = mx.max(arr[arr.len() - 1]); + } -```ts -const maxDistance = (arrays: number[][]): number => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1)! - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)!), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; + ans + } +} ``` #### JavaScript @@ -212,15 +196,19 @@ const maxDistance = (arrays: number[][]): number => * @param {number[][]} arrays * @return {number} */ -var maxDistance = arrays => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1) - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; +var maxDistance = function (arrays) { + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1) - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)); + } + return ans; +}; ``` diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.js b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.js index 6d7b30f2e7659..e853494e10c87 100644 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.js +++ b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.js @@ -3,16 +3,15 @@ * @return {number} */ var maxDistance = function (arrays) { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1) - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)); + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1) - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)); } - - return res; + return ans; }; diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.rs b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.rs new file mode 100644 index 0000000000000..d633762835fda --- /dev/null +++ b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.rs @@ -0,0 +1,19 @@ +impl Solution { + pub fn max_distance(arrays: Vec>) -> i32 { + let mut ans = 0; + let mut mi = arrays[0][0]; + let mut mx = arrays[0][arrays[0].len() - 1]; + + for i in 1..arrays.len() { + let arr = &arrays[i]; + let a = (arr[0] - mx).abs(); + let b = (arr[arr.len() - 1] - mi).abs(); + ans = ans.max(a).max(b); + + mi = mi.min(arr[0]); + mx = mx.max(arr[arr.len() - 1]); + } + + ans + } +} diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.ts b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.ts index 2e8473474a2e2..3f1276b3c0b39 100644 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.ts +++ b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution.ts @@ -1,14 +1,13 @@ function maxDistance(arrays: number[][]): number { - const n = arrays.length; - let res = 0; - let [min, max] = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - - for (let i = 0; i < n; i++) { - const a = arrays[i]; - res = Math.max(Math.max(a.at(-1)! - min, max - a[0]), res); - min = Math.min(min, a[0]); - max = Math.max(max, a.at(-1)!); + let ans = 0; + let [mi, mx] = [arrays[0][0], arrays[0].at(-1)!]; + for (let i = 1; i < arrays.length; ++i) { + const arr = arrays[i]; + const a = Math.abs(arr[0] - mx); + const b = Math.abs(arr.at(-1)! - mi); + ans = Math.max(ans, a, b); + mi = Math.min(mi, arr[0]); + mx = Math.max(mx, arr.at(-1)!); } - - return res; + return ans; } diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.js b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.js deleted file mode 100644 index b99d397cd2cab..0000000000000 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @param {number[][]} arrays - * @return {number} - */ -var maxDistance = arrays => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1) - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; diff --git a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.ts b/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.ts deleted file mode 100644 index eb94781f75af2..0000000000000 --- a/solution/0600-0699/0624.Maximum Distance in Arrays/Solution2.ts +++ /dev/null @@ -1,9 +0,0 @@ -const maxDistance = (arrays: number[][]): number => - arrays.reduce( - ([res, min, max], a) => [ - Math.max(Math.max(a.at(-1)! - min, max - a[0]), res), - Math.min(min, a[0]), - Math.max(max, a.at(-1)!), - ], - [0, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY], - )[0]; diff --git a/solution/2000-2099/2063.Vowels of All Substrings/README_EN.md b/solution/2000-2099/2063.Vowels of All Substrings/README_EN.md index 1a5b421d1cba6..3c5c21a3293dc 100644 --- a/solution/2000-2099/2063.Vowels of All Substrings/README_EN.md +++ b/solution/2000-2099/2063.Vowels of All Substrings/README_EN.md @@ -33,12 +33,12 @@ tags:
 Input: word = "aba"
 Output: 6
-Explanation:
+Explanation: 
 All possible substrings are: "a", "ab", "aba", "b", "ba", and "a".
 - "b" has 0 vowels in it
 - "a", "ab", "ba", and "a" have 1 vowel each
 - "aba" has 2 vowels in it
-Hence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6.
+Hence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6. 
 

Example 2:

@@ -46,7 +46,7 @@ Hence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6.
 Input: word = "abc"
 Output: 3
-Explanation:
+Explanation: 
 All possible substrings are: "a", "ab", "abc", "b", "bc", and "c".
 - "a", "ab", and "abc" have 1 vowel each
 - "b", "bc", and "c" have 0 vowels each
diff --git a/solution/3400-3499/3450.Maximum Students on a Single Bench/README.md b/solution/3400-3499/3450.Maximum Students on a Single Bench/README.md
index f77c8fcf2ce5d..d3d9039f84814 100644
--- a/solution/3400-3499/3450.Maximum Students on a Single Bench/README.md	
+++ b/solution/3400-3499/3450.Maximum Students on a Single Bench/README.md	
@@ -2,11 +2,14 @@
 comments: true
 difficulty: 简单
 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README.md
+tags:
+    - 数组
+    - 哈希表
 ---
 
 
 
-# [3450. 一张长椅的上最多学生 🔒](https://leetcode.cn/problems/maximum-students-on-a-single-bench)
+# [3450. 一张长椅上的最多学生 🔒](https://leetcode.cn/problems/maximum-students-on-a-single-bench)
 
 [English Version](/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README_EN.md)
 
@@ -14,85 +17,6 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3450.Ma
 
 
 
-

给定一个包含学生数据的 2 维数组 students,其中 students[i] = [student_id, bench_id] 表示学生 student_id 正坐在长椅 bench_id 上。

- -

返回单个长凳上坐着的不同学生的 最大 数量。如果没有学生,返回 0。

- -

注意:一个学生在输入中可以出现在同一张长椅上多次,但每个长椅上只能计算一次。

- -

 

- -

示例 1:

- -
-

输入:students = [[1,2],[2,2],[3,3],[1,3],[2,3]]

- -

输出:3

- -

解释:

- -
    -
  • 长椅 2 上有 2 个不同学生:[1, 2]
  • -
  • 长椅 3 上有 3 个不同学生:[1, 2, 3]
  • -
  • 一张长椅上不同学生的最大数量是 3。
  • -
-
- -

示例 2:

- -
-

输入:students = [[1,1],[2,1],[3,1],[4,2],[5,2]]

- -

输出:3

- -

示例:

- -
    -
  • 长椅 1 上有 3 个不同学生:[1, 2, 3]
  • -
  • 长椅 2 上有 2 个不同学生:[4, 5]
  • -
  • 一张长椅上不同学生的最大数量是 3。
  • -
-
- -

示例 3:

- -
-

输入:students = [[1,1],[1,1]]

- -

输出:1

- -

解释:

- -
    -
  • 一张长椅上不同学生的最大数量是 1。
  • -
-
- -

示例 4:

- -
-

输入:students = []

- -

输出:0

- -

解释:

- -
    -
  • 由于不存在学生,输出为 0。
  • -
-
- -

 

- -

提示:

- -
    -
  • 0 <= students.length <= 100
  • -
  • students[i] = [student_id, bench_id]
  • -
  • 1 <= student_id <= 100
  • -
  • 1 <= bench_id <= 100
  • -
- ## 解法 diff --git a/solution/3400-3499/3450.Maximum Students on a Single Bench/README_EN.md b/solution/3400-3499/3450.Maximum Students on a Single Bench/README_EN.md index d615781f413ee..e334f7c30ee39 100644 --- a/solution/3400-3499/3450.Maximum Students on a Single Bench/README_EN.md +++ b/solution/3400-3499/3450.Maximum Students on a Single Bench/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README_EN.md +tags: + - Array + - Hash Table --- @@ -14,82 +17,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3450.Ma -

You are given a 2D integer array of student data students, where students[i] = [student_id, bench_id] represents that student student_id is sitting on the bench bench_id.

- -

Return the maximum number of unique students sitting on any single bench. If no students are present, return 0.

- -

Note: A student can appear multiple times on the same bench in the input, but they should be counted only once per bench.

- -

 

-

Example 1:

- -
-

Input: students = [[1,2],[2,2],[3,3],[1,3],[2,3]]

- -

Output: 3

- -

Explanation:

- -
    -
  • Bench 2 has two unique students: [1, 2].
  • -
  • Bench 3 has three unique students: [1, 2, 3].
  • -
  • The maximum number of unique students on a single bench is 3.
  • -
-
- -

Example 2:

- -
-

Input: students = [[1,1],[2,1],[3,1],[4,2],[5,2]]

- -

Output: 3

- -

Explanation:

- -
    -
  • Bench 1 has three unique students: [1, 2, 3].
  • -
  • Bench 2 has two unique students: [4, 5].
  • -
  • The maximum number of unique students on a single bench is 3.
  • -
-
- -

Example 3:

- -
-

Input: students = [[1,1],[1,1]]

- -

Output: 1

- -

Explanation:

- -
    -
  • The maximum number of unique students on a single bench is 1.
  • -
-
- -

Example 4:

- -
-

Input: students = []

- -

Output: 0

- -

Explanation:

- -
    -
  • Since no students are present, the output is 0.
  • -
-
- -

 

-

Constraints:

- -
    -
  • 0 <= students.length <= 100
  • -
  • students[i] = [student_id, bench_id]
  • -
  • 1 <= student_id <= 100
  • -
  • 1 <= bench_id <= 100
  • -
+None diff --git a/solution/3400-3499/3452.Sum of Good Numbers/README.md b/solution/3400-3499/3452.Sum of Good Numbers/README.md index ef81e6f452c7d..c5466866a657d 100644 --- a/solution/3400-3499/3452.Sum of Good Numbers/README.md +++ b/solution/3400-3499/3452.Sum of Good Numbers/README.md @@ -2,6 +2,8 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README.md +tags: + - 数组 --- diff --git a/solution/3400-3499/3452.Sum of Good Numbers/README_EN.md b/solution/3400-3499/3452.Sum of Good Numbers/README_EN.md index 17216fdf82b07..48e34811bf89a 100644 --- a/solution/3400-3499/3452.Sum of Good Numbers/README_EN.md +++ b/solution/3400-3499/3452.Sum of Good Numbers/README_EN.md @@ -2,6 +2,8 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README_EN.md +tags: + - Array --- diff --git a/solution/3400-3499/3453.Separate Squares I/README.md b/solution/3400-3499/3453.Separate Squares I/README.md index 50811622ef8e2..fbdd39fad4695 100644 --- a/solution/3400-3499/3453.Separate Squares I/README.md +++ b/solution/3400-3499/3453.Separate Squares I/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3453.Separate%20Squares%20I/README.md +tags: + - 数组 + - 二分查找 --- diff --git a/solution/3400-3499/3453.Separate Squares I/README_EN.md b/solution/3400-3499/3453.Separate Squares I/README_EN.md index 6c843543f52e6..2031335156c11 100644 --- a/solution/3400-3499/3453.Separate Squares I/README_EN.md +++ b/solution/3400-3499/3453.Separate Squares I/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3453.Separate%20Squares%20I/README_EN.md +tags: + - Array + - Binary Search --- @@ -67,6 +70,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3453.Se
  • squares[i].length == 3
  • 0 <= xi, yi <= 109
  • 1 <= li <= 109
  • +
  • The total area of all the squares will not exceed 1012.
  • diff --git a/solution/3400-3499/3454.Separate Squares II/README.md b/solution/3400-3499/3454.Separate Squares II/README.md index 22d0a514b0508..886a31db50fd5 100644 --- a/solution/3400-3499/3454.Separate Squares II/README.md +++ b/solution/3400-3499/3454.Separate Squares II/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3454.Separate%20Squares%20II/README.md +tags: + - 线段树 + - 数组 + - 二分查找 + - 扫描线 --- diff --git a/solution/3400-3499/3454.Separate Squares II/README_EN.md b/solution/3400-3499/3454.Separate Squares II/README_EN.md index 2a4ceae035c0f..23113d7c4de44 100644 --- a/solution/3400-3499/3454.Separate Squares II/README_EN.md +++ b/solution/3400-3499/3454.Separate Squares II/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3454.Separate%20Squares%20II/README_EN.md +tags: + - Segment Tree + - Array + - Binary Search + - Line Sweep --- @@ -60,6 +65,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3454.Se
  • squares[i].length == 3
  • 0 <= xi, yi <= 109
  • 1 <= li <= 109
  • +
  • The total area of all the squares will not exceed 1015.
  • diff --git a/solution/3400-3499/3455.Shortest Matching Substring/README.md b/solution/3400-3499/3455.Shortest Matching Substring/README.md index 00199149575f2..1a3af574786ed 100644 --- a/solution/3400-3499/3455.Shortest Matching Substring/README.md +++ b/solution/3400-3499/3455.Shortest Matching Substring/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3455.Shortest%20Matching%20Substring/README.md +tags: + - 双指针 + - 字符串 + - 二分查找 + - 字符串匹配 --- diff --git a/solution/3400-3499/3455.Shortest Matching Substring/README_EN.md b/solution/3400-3499/3455.Shortest Matching Substring/README_EN.md index 502f8050ef560..8c05f0c0c364c 100644 --- a/solution/3400-3499/3455.Shortest Matching Substring/README_EN.md +++ b/solution/3400-3499/3455.Shortest Matching Substring/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3455.Shortest%20Matching%20Substring/README_EN.md +tags: + - Two Pointers + - String + - Binary Search + - String Matching --- diff --git a/solution/3400-3499/3456.Find Special Substring of Length K/README.md b/solution/3400-3499/3456.Find Special Substring of Length K/README.md index 4e67dee4813b0..3962f12066700 100644 --- a/solution/3400-3499/3456.Find Special Substring of Length K/README.md +++ b/solution/3400-3499/3456.Find Special Substring of Length K/README.md @@ -2,6 +2,8 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README.md +tags: + - 字符串 --- diff --git a/solution/3400-3499/3456.Find Special Substring of Length K/README_EN.md b/solution/3400-3499/3456.Find Special Substring of Length K/README_EN.md index 60a5fab3f76af..77a454f18cd10 100644 --- a/solution/3400-3499/3456.Find Special Substring of Length K/README_EN.md +++ b/solution/3400-3499/3456.Find Special Substring of Length K/README_EN.md @@ -2,6 +2,8 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README_EN.md +tags: + - String --- diff --git a/solution/3400-3499/3457.Eat Pizzas!/README.md b/solution/3400-3499/3457.Eat Pizzas!/README.md index a8c8d4b8ec5bf..37466f30ce45a 100644 --- a/solution/3400-3499/3457.Eat Pizzas!/README.md +++ b/solution/3400-3499/3457.Eat Pizzas!/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3457.Eat%20Pizzas%21/README.md +tags: + - 贪心 + - 数组 + - 排序 --- diff --git a/solution/3400-3499/3457.Eat Pizzas!/README_EN.md b/solution/3400-3499/3457.Eat Pizzas!/README_EN.md index c3905363e205d..1e1ebc8921062 100644 --- a/solution/3400-3499/3457.Eat Pizzas!/README_EN.md +++ b/solution/3400-3499/3457.Eat Pizzas!/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3457.Eat%20Pizzas%21/README_EN.md +tags: + - Greedy + - Array + - Sorting --- diff --git a/solution/3400-3499/3458.Select K Disjoint Special Substrings/README.md b/solution/3400-3499/3458.Select K Disjoint Special Substrings/README.md index 48fd2a43ce073..7b61949cdcadb 100644 --- a/solution/3400-3499/3458.Select K Disjoint Special Substrings/README.md +++ b/solution/3400-3499/3458.Select K Disjoint Special Substrings/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README.md +tags: + - 贪心 + - 哈希表 + - 字符串 + - 动态规划 + - 排序 --- diff --git a/solution/3400-3499/3458.Select K Disjoint Special Substrings/README_EN.md b/solution/3400-3499/3458.Select K Disjoint Special Substrings/README_EN.md index f4b57e88b46a6..98d46a4030c86 100644 --- a/solution/3400-3499/3458.Select K Disjoint Special Substrings/README_EN.md +++ b/solution/3400-3499/3458.Select K Disjoint Special Substrings/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README_EN.md +tags: + - Greedy + - Hash Table + - String + - Dynamic Programming + - Sorting --- diff --git a/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README.md b/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README.md index 80ac04a8364c4..27d543ba1e569 100644 --- a/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README.md +++ b/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README.md +tags: + - 记忆化搜索 + - 数组 + - 动态规划 + - 矩阵 --- diff --git a/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README_EN.md b/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README_EN.md index 73bc45d22d036..29fad9abda361 100644 --- a/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README_EN.md +++ b/solution/3400-3499/3459.Length of Longest V-Shaped Diagonal Segment/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README_EN.md +tags: + - Memoization + - Array + - Dynamic Programming + - Matrix --- diff --git a/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README.md b/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README.md index 70fffe6cf40a2..e743cfdbf1642 100644 --- a/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README.md +++ b/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README.md @@ -6,7 +6,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3460.Lo -# [3460. Longest Common Prefix After at Most One Removal 🔒](https://leetcode.cn/problems/longest-common-prefix-after-at-most-one-removal) +# [3460. 最多删除一次后的最长公共前缀 🔒](https://leetcode.cn/problems/longest-common-prefix-after-at-most-one-removal) [English Version](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README_EN.md) @@ -14,70 +14,6 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3460.Lo -

    You are given two strings s and t.

    - -

    Return the length of the longest common prefix between s and t after removing at most one character from s.

    - -

    Note: s can be left without any removal.

    - -

     

    -

    Example 1:

    - -
    -

    Input: s = "madxa", t = "madam"

    - -

    Output: 4

    - -

    Explanation:

    - -

    Removing s[3] from s results in "mada", which has a longest common prefix of length 4 with t.

    -
    - -

    Example 2:

    - -
    -

    Input: s = "leetcode", t = "eetcode"

    - -

    Output: 7

    - -

    Explanation:

    - -

    Removing s[0] from s results in "eetcode", which matches t.

    -
    - -

    Example 3:

    - -
    -

    Input: s = "one", t = "one"

    - -

    Output: 3

    - -

    Explanation:

    - -

    No removal is needed.

    -
    - -

    Example 4:

    - -
    -

    Input: s = "a", t = "b"

    - -

    Output: 0

    - -

    Explanation:

    - -

    s and t cannot have a common prefix.

    -
    - -

     

    -

    Constraints:

    - -
      -
    • 1 <= s.length <= 105
    • -
    • 1 <= t.length <= 105
    • -
    • s and t contain only lowercase English letters.
    • -
    - ## 解法 diff --git a/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README_EN.md b/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README_EN.md index d69d8b398493e..1a04a2926b151 100644 --- a/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README_EN.md +++ b/solution/3400-3499/3460.Longest Common Prefix After at Most One Removal/README_EN.md @@ -14,69 +14,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3460.Lo -

    You are given two strings s and t.

    - -

    Return the length of the longest common prefix between s and t after removing at most one character from s.

    - -

    Note: s can be left without any removal.

    - -

     

    -

    Example 1:

    - -
    -

    Input: s = "madxa", t = "madam"

    - -

    Output: 4

    - -

    Explanation:

    - -

    Removing s[3] from s results in "mada", which has a longest common prefix of length 4 with t.

    -
    - -

    Example 2:

    - -
    -

    Input: s = "leetcode", t = "eetcode"

    - -

    Output: 7

    - -

    Explanation:

    - -

    Removing s[0] from s results in "eetcode", which matches t.

    -
    - -

    Example 3:

    - -
    -

    Input: s = "one", t = "one"

    - -

    Output: 3

    - -

    Explanation:

    - -

    No removal is needed.

    -
    - -

    Example 4:

    - -
    -

    Input: s = "a", t = "b"

    - -

    Output: 0

    - -

    Explanation:

    - -

    s and t cannot have a common prefix.

    -
    - -

     

    -

    Constraints:

    - -
      -
    • 1 <= s.length <= 105
    • -
    • 1 <= t.length <= 105
    • -
    • s and t contain only lowercase English letters.
    • -
    +None diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index 30cf41231888b..5afa40278ee76 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -309,7 +309,7 @@ | 3415 | [查找具有三个连续数字的产品](/solution/3400-3499/3415.Find%20Products%20with%20Three%20Consecutive%20Digits/README.md) | `数据库` | 简单 | 🔒 | | 3421 | [查找进步的学生](/solution/3400-3499/3421.Find%20Students%20Who%20Improved/README.md) | `数据库` | 中等 | | | 3436 | [查找合法邮箱](/solution/3400-3499/3436.Find%20Valid%20Emails/README.md) | `数据库` | 简单 | | -| 3451 | [查找无效的 IP 地址](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README.md) | | 困难 | | +| 3451 | [查找无效的 IP 地址](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README.md) | `数据库` | 困难 | | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index 77a7de88cae67..f7cf78a8a6c29 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -307,7 +307,7 @@ Press Control + F(or Command + F on | 3415 | [Find Products with Three Consecutive Digits](/solution/3400-3499/3415.Find%20Products%20with%20Three%20Consecutive%20Digits/README_EN.md) | `Database` | Easy | 🔒 | | 3421 | [Find Students Who Improved](/solution/3400-3499/3421.Find%20Students%20Who%20Improved/README_EN.md) | `Database` | Medium | | | 3436 | [Find Valid Emails](/solution/3400-3499/3436.Find%20Valid%20Emails/README_EN.md) | `Database` | Easy | | -| 3451 | [Find Invalid IP Addresses](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README_EN.md) | | Hard | | +| 3451 | [Find Invalid IP Addresses](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README_EN.md) | `Database` | Hard | | ## Copyright diff --git a/solution/README.md b/solution/README.md index 78300adad698a..ff80698f8aa47 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3460,17 +3460,17 @@ | 3447 | [将元素分配给有约束条件的组](/solution/3400-3499/3447.Assign%20Elements%20to%20Groups%20with%20Constraints/README.md) | `数组`,`哈希表` | 中等 | 第 436 场周赛 | | 3448 | [统计可以被最后一个数位整除的子字符串数目](/solution/3400-3499/3448.Count%20Substrings%20Divisible%20By%20Last%20Digit/README.md) | `字符串`,`动态规划` | 困难 | 第 436 场周赛 | | 3449 | [最大化游戏分数的最小值](/solution/3400-3499/3449.Maximize%20the%20Minimum%20Game%20Score/README.md) | `贪心`,`数组`,`二分查找` | 困难 | 第 436 场周赛 | -| 3450 | [一张长椅的上最多学生](/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README.md) | | 简单 | 🔒 | -| 3451 | [查找无效的 IP 地址](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README.md) | | 困难 | | -| 3452 | [好数字之和](/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README.md) | | 简单 | 第 150 场双周赛 | -| 3453 | [分割正方形 I](/solution/3400-3499/3453.Separate%20Squares%20I/README.md) | | 中等 | 第 150 场双周赛 | -| 3454 | [分割正方形 II](/solution/3400-3499/3454.Separate%20Squares%20II/README.md) | | 困难 | 第 150 场双周赛 | -| 3455 | [最短匹配子字符串](/solution/3400-3499/3455.Shortest%20Matching%20Substring/README.md) | | 困难 | 第 150 场双周赛 | -| 3456 | [找出长度为 K 的特殊子字符串](/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README.md) | | 简单 | 第 437 场周赛 | -| 3457 | [吃披萨](/solution/3400-3499/3457.Eat%20Pizzas%21/README.md) | | 中等 | 第 437 场周赛 | -| 3458 | [选择 K 个互不重叠的特殊子字符串](/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README.md) | | 中等 | 第 437 场周赛 | -| 3459 | [最长 V 形对角线段的长度](/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README.md) | | 困难 | 第 437 场周赛 | -| 3460 | [Longest Common Prefix After at Most One Removal](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README.md) | | 中等 | 🔒 | +| 3450 | [一张长椅上的最多学生](/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README.md) | `数组`,`哈希表` | 简单 | 🔒 | +| 3451 | [查找无效的 IP 地址](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README.md) | `数据库` | 困难 | | +| 3452 | [好数字之和](/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README.md) | `数组` | 简单 | 第 150 场双周赛 | +| 3453 | [分割正方形 I](/solution/3400-3499/3453.Separate%20Squares%20I/README.md) | `数组`,`二分查找` | 中等 | 第 150 场双周赛 | +| 3454 | [分割正方形 II](/solution/3400-3499/3454.Separate%20Squares%20II/README.md) | `线段树`,`数组`,`二分查找`,`扫描线` | 困难 | 第 150 场双周赛 | +| 3455 | [最短匹配子字符串](/solution/3400-3499/3455.Shortest%20Matching%20Substring/README.md) | `双指针`,`字符串`,`二分查找`,`字符串匹配` | 困难 | 第 150 场双周赛 | +| 3456 | [找出长度为 K 的特殊子字符串](/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README.md) | `字符串` | 简单 | 第 437 场周赛 | +| 3457 | [吃披萨](/solution/3400-3499/3457.Eat%20Pizzas%21/README.md) | `贪心`,`数组`,`排序` | 中等 | 第 437 场周赛 | +| 3458 | [选择 K 个互不重叠的特殊子字符串](/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README.md) | `贪心`,`哈希表`,`字符串`,`动态规划`,`排序` | 中等 | 第 437 场周赛 | +| 3459 | [最长 V 形对角线段的长度](/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README.md) | `记忆化搜索`,`数组`,`动态规划`,`矩阵` | 困难 | 第 437 场周赛 | +| 3460 | [最多删除一次后的最长公共前缀](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README.md) | | 中等 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 5c91e1126f9f2..21a1a0efa95c0 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3458,16 +3458,16 @@ Press Control + F(or Command + F on | 3447 | [Assign Elements to Groups with Constraints](/solution/3400-3499/3447.Assign%20Elements%20to%20Groups%20with%20Constraints/README_EN.md) | `Array`,`Hash Table` | Medium | Weekly Contest 436 | | 3448 | [Count Substrings Divisible By Last Digit](/solution/3400-3499/3448.Count%20Substrings%20Divisible%20By%20Last%20Digit/README_EN.md) | `String`,`Dynamic Programming` | Hard | Weekly Contest 436 | | 3449 | [Maximize the Minimum Game Score](/solution/3400-3499/3449.Maximize%20the%20Minimum%20Game%20Score/README_EN.md) | `Greedy`,`Array`,`Binary Search` | Hard | Weekly Contest 436 | -| 3450 | [Maximum Students on a Single Bench](/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README_EN.md) | | Easy | 🔒 | -| 3451 | [Find Invalid IP Addresses](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README_EN.md) | | Hard | | -| 3452 | [Sum of Good Numbers](/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README_EN.md) | | Easy | Biweekly Contest 150 | -| 3453 | [Separate Squares I](/solution/3400-3499/3453.Separate%20Squares%20I/README_EN.md) | | Medium | Biweekly Contest 150 | -| 3454 | [Separate Squares II](/solution/3400-3499/3454.Separate%20Squares%20II/README_EN.md) | | Hard | Biweekly Contest 150 | -| 3455 | [Shortest Matching Substring](/solution/3400-3499/3455.Shortest%20Matching%20Substring/README_EN.md) | | Hard | Biweekly Contest 150 | -| 3456 | [Find Special Substring of Length K](/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README_EN.md) | | Easy | Weekly Contest 437 | -| 3457 | [Eat Pizzas!](/solution/3400-3499/3457.Eat%20Pizzas%21/README_EN.md) | | Medium | Weekly Contest 437 | -| 3458 | [Select K Disjoint Special Substrings](/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README_EN.md) | | Medium | Weekly Contest 437 | -| 3459 | [Length of Longest V-Shaped Diagonal Segment](/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README_EN.md) | | Hard | Weekly Contest 437 | +| 3450 | [Maximum Students on a Single Bench](/solution/3400-3499/3450.Maximum%20Students%20on%20a%20Single%20Bench/README_EN.md) | `Array`,`Hash Table` | Easy | 🔒 | +| 3451 | [Find Invalid IP Addresses](/solution/3400-3499/3451.Find%20Invalid%20IP%20Addresses/README_EN.md) | `Database` | Hard | | +| 3452 | [Sum of Good Numbers](/solution/3400-3499/3452.Sum%20of%20Good%20Numbers/README_EN.md) | `Array` | Easy | Biweekly Contest 150 | +| 3453 | [Separate Squares I](/solution/3400-3499/3453.Separate%20Squares%20I/README_EN.md) | `Array`,`Binary Search` | Medium | Biweekly Contest 150 | +| 3454 | [Separate Squares II](/solution/3400-3499/3454.Separate%20Squares%20II/README_EN.md) | `Segment Tree`,`Array`,`Binary Search`,`Line Sweep` | Hard | Biweekly Contest 150 | +| 3455 | [Shortest Matching Substring](/solution/3400-3499/3455.Shortest%20Matching%20Substring/README_EN.md) | `Two Pointers`,`String`,`Binary Search`,`String Matching` | Hard | Biweekly Contest 150 | +| 3456 | [Find Special Substring of Length K](/solution/3400-3499/3456.Find%20Special%20Substring%20of%20Length%20K/README_EN.md) | `String` | Easy | Weekly Contest 437 | +| 3457 | [Eat Pizzas!](/solution/3400-3499/3457.Eat%20Pizzas%21/README_EN.md) | `Greedy`,`Array`,`Sorting` | Medium | Weekly Contest 437 | +| 3458 | [Select K Disjoint Special Substrings](/solution/3400-3499/3458.Select%20K%20Disjoint%20Special%20Substrings/README_EN.md) | `Greedy`,`Hash Table`,`String`,`Dynamic Programming`,`Sorting` | Medium | Weekly Contest 437 | +| 3459 | [Length of Longest V-Shaped Diagonal Segment](/solution/3400-3499/3459.Length%20of%20Longest%20V-Shaped%20Diagonal%20Segment/README_EN.md) | `Memoization`,`Array`,`Dynamic Programming`,`Matrix` | Hard | Weekly Contest 437 | | 3460 | [Longest Common Prefix After at Most One Removal](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README_EN.md) | | Medium | 🔒 | ## Copyright