diff --git a/solution/2200-2299/2296.Design a Text Editor/README.md b/solution/2200-2299/2296.Design a Text Editor/README.md index 7797eda5351a2..1d62b90fa0f07 100644 --- a/solution/2200-2299/2296.Design a Text Editor/README.md +++ b/solution/2200-2299/2296.Design a Text Editor/README.md @@ -62,7 +62,7 @@ textEditor.deleteText(4); // 返回 4 // 删除了 4 个字符。 textEditor.addText("practice"); // 当前文本为 "leetpractice|" 。 textEditor.cursorRight(3); // 返回 "etpractice" - // 当前文本为 "leetpractice|". + // 当前文本为 "leetpractice|". // 光标无法移动到文本以外,所以无法移动。 // "etpractice" 是光标左边的 10 个字符。 textEditor.cursorLeft(8); // 返回 "leet" @@ -102,12 +102,12 @@ textEditor.cursorRight(6); // 返回 "practi" ### 方法一:左右栈 -我们可以使用两个栈 `left` 和 `right`,其中栈 `left` 存储光标左边的字符,另一个栈 `right` 存储光标右边的字符。 +我们可以使用两个栈 $\textit{left}$ 和 $\textit{right}$,其中栈 $\textit{left}$ 存储光标左边的字符,另一个栈 $\textit{right}$ 存储光标右边的字符。 -- 当调用 `addText` 方法时,我们将 `text` 中的字符依次入栈 `left`。时间复杂度 $O(|text|)$。 -- 当调用 `deleteText` 方法时,我们将 `left` 中的字符出栈最多 $k$ 次。时间复杂度 $O(k)$。 -- 当调用 `cursorLeft` 方法时,我们将 `left` 中的字符出栈最多 $k$ 次,然后将出栈的字符依次入栈 `right`,最后返回 `left` 栈最多 $10$ 个字符。时间复杂度 $O(k)$。 -- 当调用 `cursorRight` 方法时,我们将 `right` 中的字符出栈最多 $k$ 次,然后将出栈的字符依次入栈 `left`,最后返回 `left` 栈最多 $10$ 个字符。时间复杂度 $O(k)$。 +- 当调用 $\text{addText}$ 方法时,我们将 $\text{text}$ 中的字符依次入栈 $\text{left}$。时间复杂度 $O(|\text{text}|)$。 +- 当调用 $\text{deleteText}$ 方法时,我们将 $\text{left}$ 中的字符出栈最多 $k$ 次。时间复杂度 $O(k)$。 +- 当调用 $\text{cursorLeft}$ 方法时,我们将 $\text{left}$ 中的字符出栈最多 $k$ 次,然后将出栈的字符依次入栈 $\text{right}$,最后返回 $\text{left}$ 栈最多 $10$ 个字符。时间复杂度 $O(k)$。 +- 当调用 $\text{cursorRight}$ 方法时,我们将 $\text{right}$ 中的字符出栈最多 $k$ 次,然后将出栈的字符依次入栈 $\text{left}$,最后返回 $\text{left}$ 栈最多 $10$ 个字符。时间复杂度 $O(k)$。 @@ -352,6 +352,59 @@ class TextEditor { */ ``` +#### Rust + +```rust +struct TextEditor { + left: String, + right: String, +} + +impl TextEditor { + fn new() -> Self { + TextEditor { + left: String::new(), + right: String::new(), + } + } + + fn add_text(&mut self, text: String) { + self.left.push_str(&text); + } + + fn delete_text(&mut self, k: i32) -> i32 { + let k = k.min(self.left.len() as i32) as usize; + self.left.truncate(self.left.len() - k); + k as i32 + } + + fn cursor_left(&mut self, k: i32) -> String { + let k = k.min(self.left.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.left.pop() { + self.right.push(c); + } + } + self.get_last_10_chars() + } + + fn cursor_right(&mut self, k: i32) -> String { + let k = k.min(self.right.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.right.pop() { + self.left.push(c); + } + } + self.get_last_10_chars() + } + + fn get_last_10_chars(&self) -> String { + let len = self.left.len(); + self.left[len.saturating_sub(10)..].to_string() + } +} +``` + diff --git a/solution/2200-2299/2296.Design a Text Editor/README_EN.md b/solution/2200-2299/2296.Design a Text Editor/README_EN.md index daa68bca89b23..7b62bdce0d7b9 100644 --- a/solution/2200-2299/2296.Design a Text Editor/README_EN.md +++ b/solution/2200-2299/2296.Design a Text Editor/README_EN.md @@ -57,11 +57,11 @@ tags: TextEditor textEditor = new TextEditor(); // The current text is "|". (The '|' character represents the cursor) textEditor.addText("leetcode"); // The current text is "leetcode|". textEditor.deleteText(4); // return 4 - // The current text is "leet|". + // The current text is "leet|". // 4 characters were deleted. -textEditor.addText("practice"); // The current text is "leetpractice|". +textEditor.addText("practice"); // The current text is "leetpractice|". textEditor.cursorRight(3); // return "etpractice" - // The current text is "leetpractice|". + // The current text is "leetpractice|". // The cursor cannot be moved beyond the actual text and thus did not move. // "etpractice" is the last 10 characters to the left of the cursor. textEditor.cursorLeft(8); // return "leet" @@ -72,7 +72,7 @@ textEditor.deleteText(10); // return 4 // Only 4 characters were deleted. textEditor.cursorLeft(2); // return "" // The current text is "|practice". - // The cursor cannot be moved beyond the actual text and thus did not move. + // The cursor cannot be moved beyond the actual text and thus did not move. // "" is the last min(10, 0) = 0 characters to the left of the cursor. textEditor.cursorRight(6); // return "practi" // The current text is "practi|ce". @@ -99,12 +99,12 @@ textEditor.cursorRight(6); // return "practi" ### Solution 1: Left and Right Stacks -We can use two stacks, `left` and `right`, where the `left` stack stores the characters to the left of the cursor, and the `right` stack stores the characters to the right of the cursor. +We can use two stacks, $\textit{left}$ and $\textit{right}$, where the stack $\textit{left}$ stores the characters to the left of the cursor, and the stack $\textit{right}$ stores the characters to the right of the cursor. -- When the `addText` method is called, we push the characters from `text` onto the `left` stack one by one. The time complexity is $O(|\textit{text}|)$. -- When the `deleteText` method is called, we pop characters from the `left` stack up to $k$ times. The time complexity is $O(k)$. -- When the `cursorLeft` method is called, we pop characters from the `left` stack up to $k$ times, then push the popped characters onto the `right` stack, and finally return up to $10$ characters from the `left` stack. The time complexity is $O(k)$. -- When the `cursorRight` method is called, we pop characters from the `right` stack up to $k$ times, then push the popped characters onto the `left` stack, and finally return up to $10$ characters from the `left` stack. The time complexity is $O(k)$. +- When calling the $\text{addText}$ method, we push the characters in $\text{text}$ onto the $\text{left}$ stack one by one. The time complexity is $O(|\text{text}|)$. +- When calling the $\text{deleteText}$ method, we pop characters from the $\text{left}$ stack up to $k$ times. The time complexity is $O(k)$. +- When calling the $\text{cursorLeft}$ method, we pop characters from the $\text{left}$ stack up to $k$ times, then push the popped characters onto the $\text{right}$ stack one by one, and finally return up to 10 characters from the $\text{left}$ stack. The time complexity is $O(k)$. +- When calling the $\text{cursorRight}$ method, we pop characters from the $\text{right}$ stack up to $k$ times, then push the popped characters onto the $\text{left}$ stack one by one, and finally return up to 10 characters from the $\text{left}$ stack. The time complexity is $O(k)$. @@ -349,6 +349,59 @@ class TextEditor { */ ``` +#### Rust + +```rust +struct TextEditor { + left: String, + right: String, +} + +impl TextEditor { + fn new() -> Self { + TextEditor { + left: String::new(), + right: String::new(), + } + } + + fn add_text(&mut self, text: String) { + self.left.push_str(&text); + } + + fn delete_text(&mut self, k: i32) -> i32 { + let k = k.min(self.left.len() as i32) as usize; + self.left.truncate(self.left.len() - k); + k as i32 + } + + fn cursor_left(&mut self, k: i32) -> String { + let k = k.min(self.left.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.left.pop() { + self.right.push(c); + } + } + self.get_last_10_chars() + } + + fn cursor_right(&mut self, k: i32) -> String { + let k = k.min(self.right.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.right.pop() { + self.left.push(c); + } + } + self.get_last_10_chars() + } + + fn get_last_10_chars(&self) -> String { + let len = self.left.len(); + self.left[len.saturating_sub(10)..].to_string() + } +} +``` + diff --git a/solution/2200-2299/2296.Design a Text Editor/Solution.rs b/solution/2200-2299/2296.Design a Text Editor/Solution.rs new file mode 100644 index 0000000000000..82513c1f1b220 --- /dev/null +++ b/solution/2200-2299/2296.Design a Text Editor/Solution.rs @@ -0,0 +1,48 @@ +struct TextEditor { + left: String, + right: String, +} + +impl TextEditor { + fn new() -> Self { + TextEditor { + left: String::new(), + right: String::new(), + } + } + + fn add_text(&mut self, text: String) { + self.left.push_str(&text); + } + + fn delete_text(&mut self, k: i32) -> i32 { + let k = k.min(self.left.len() as i32) as usize; + self.left.truncate(self.left.len() - k); + k as i32 + } + + fn cursor_left(&mut self, k: i32) -> String { + let k = k.min(self.left.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.left.pop() { + self.right.push(c); + } + } + self.get_last_10_chars() + } + + fn cursor_right(&mut self, k: i32) -> String { + let k = k.min(self.right.len() as i32) as usize; + for _ in 0..k { + if let Some(c) = self.right.pop() { + self.left.push(c); + } + } + self.get_last_10_chars() + } + + fn get_last_10_chars(&self) -> String { + let len = self.left.len(); + self.left[len.saturating_sub(10)..].to_string() + } +} 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 13cb2499f9251..a062115f78f11 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 @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README.md +tags: + - 双指针 + - 字符串 --- 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..6c46b96d8be30 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 @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README_EN.md +tags: + - Two Pointers + - String --- diff --git a/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README.md b/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README.md index b406cea4d2d56..cfd024007d646 100644 --- a/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README.md +++ b/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README.md +tags: + - 数学 + - 字符串 + - 组合数学 + - 数论 + - 模拟 --- diff --git a/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README_EN.md b/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README_EN.md index 6fc69644e5610..26c19d2343e03 100644 --- a/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README_EN.md +++ b/solution/3400-3499/3461.Check If Digits Are Equal in String After Operations I/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README_EN.md +tags: + - Math + - String + - Combinatorics + - Number Theory + - Simulation --- diff --git a/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README.md b/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README.md index 9e611932efe20..b6a306a587401 100644 --- a/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README.md +++ b/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README.md +tags: + - 贪心 + - 数组 + - 矩阵 + - 排序 + - 堆(优先队列) --- diff --git a/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README_EN.md b/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README_EN.md index 52635f560ad25..cc53a5701052e 100644 --- a/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README_EN.md +++ b/solution/3400-3499/3462.Maximum Sum With at Most K Elements/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README_EN.md +tags: + - Greedy + - Array + - Matrix + - Sorting + - Heap (Priority Queue) --- diff --git a/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README.md b/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README.md index 25c6ae78db486..52a1fba63f00a 100644 --- a/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README.md +++ b/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README.md +tags: + - 数学 + - 字符串 + - 组合数学 + - 数论 --- diff --git a/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README_EN.md b/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README_EN.md index 9718518936816..ba31746258628 100644 --- a/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README_EN.md +++ b/solution/3400-3499/3463.Check If Digits Are Equal in String After Operations II/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README_EN.md +tags: + - Math + - String + - Combinatorics + - Number Theory --- diff --git a/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README.md b/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README.md index 58fc86fa59c82..9f42a6cd4e9f8 100644 --- a/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README.md +++ b/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README.md +tags: + - 贪心 + - 数组 + - 二分查找 --- diff --git a/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README_EN.md b/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README_EN.md index 1df564c1fd1e0..06c4fa75d0d38 100644 --- a/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README_EN.md +++ b/solution/3400-3499/3464.Maximize the Distance Between Points on a Square/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README_EN.md +tags: + - Greedy + - Array + - Binary Search --- diff --git a/solution/3400-3499/3465.Find Products with Valid Serial Numbers/README.md b/solution/3400-3499/3465.Find Products with Valid Serial Numbers/README.md index 0d64277ce056e..2246158fb2d19 100644 --- a/solution/3400-3499/3465.Find Products with Valid Serial Numbers/README.md +++ b/solution/3400-3499/3465.Find Products with Valid Serial Numbers/README.md @@ -8,7 +8,7 @@ tags: -# [3465. Find Products with Valid Serial Numbers](https://leetcode.cn/problems/find-products-with-valid-serial-numbers) +# [3465. 查找具有有效序列号的产品](https://leetcode.cn/problems/find-products-with-valid-serial-numbers) [English Version](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README_EN.md) @@ -16,7 +16,7 @@ tags: -

Table: products

+

表:products

 +--------------+------------+
@@ -26,30 +26,31 @@ tags:
 | product_name | varchar    |
 | description  | varchar    |
 +--------------+------------+
-(product_id) is the unique key for this table.
-Each row in the table represents a product with its unique ID, name, and description.
+(product_id) 是这张表的唯一主键。
+这张表的每一行表示一个产品的唯一 ID,名字和描述。
 
-

Write a solution to find all products whose description contains a valid serial number pattern. A valid serial number follows these rules:

+

编写一个解决方案来找到所有描述中 包含一个有效序列号 模式的产品。一个有效序列号符合下述规则:

-

Return the result table ordered by product_id in ascending order.

+

返回结果表以 product_id 升序 排序。

-

The result format is in the following example.

+

结果格式如下所示。

 

-

Example:

+ +

示例:

-

Input:

+

输入:

-

products table:

+

products 表:

 +------------+--------------+------------------------------------------------------+
@@ -63,7 +64,7 @@ Each row in the table represents a product with its unique ID, name, and descrip
 +------------+--------------+------------------------------------------------------+
     
-

Output:

+

输出:

 +------------+--------------+------------------------------------------------------+
@@ -75,17 +76,17 @@ Each row in the table represents a product with its unique ID, name, and descrip
 +------------+--------------+------------------------------------------------------+
     
-

Explanation:

+

解释:

-

The result table is ordered by product_id in ascending order.

+

结果表以 product_id 升序排序。

diff --git a/solution/3400-3499/3466.Maximum Coin Collection/README.md b/solution/3400-3499/3466.Maximum Coin Collection/README.md index bff3146ac36a0..2267717d80e9e 100644 --- a/solution/3400-3499/3466.Maximum Coin Collection/README.md +++ b/solution/3400-3499/3466.Maximum Coin Collection/README.md @@ -6,7 +6,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma -# [3466. 最大硬币收藏量 🔒](https://leetcode.cn/problems/maximum-coin-collection) +# [3466. 最大硬币收集量 🔒](https://leetcode.cn/problems/maximum-coin-collection) [English Version](/solution/3400-3499/3466.Maximum%20Coin%20Collection/README_EN.md) @@ -14,21 +14,21 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma -

Mario 在双车道高速公路上行驶,每英里都有硬币。给定两个整数数组,lane1 和 lane2,其中第 i 个下标的值表示他在车道上处于第 i 英里时获得或失去的硬币数量。

+

马里奥在双车道高速公路上行驶,每英里都有硬币。给定两个整数数组,lane1 和 lane2,其中第 i 个下标的值表示他在车道上处于第 i 英里时获得或失去的硬币数量。

-

Mario 可以在任何地方进入高速公路,并在行驶 至少 一英里后随时退出。Mario 总是从 1 号车道进入高速公路,但 最多 可以换道 2 次。

+

马里奥可以在任何地方进入高速公路,并在行驶 至少 一英里后随时退出。马里奥总是从 1 号车道进入高速公路,但 最多 可以换道 2 次。

-

换道 是指 Mario 从车道 1 换到车道 2,反之亦然。

+

换道 是指马里奥从车道 1 换到车道 2,反之亦然。

-

返回 Mario 在进行 最多 2 次换道 后 最多 可以获得的硬币数。

+

返回马里奥在进行 最多 2 次换道 后 最多 可以获得的硬币数。

-

注意:Mario 可以在进入高速公路或退出高速公路之前立即切换车道。

+

注意:马里奥可以在进入高速公路或退出高速公路之前立即切换车道。

 

@@ -42,12 +42,12 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma

解释:

-

Mario 收集了 1 + 10 + 0 + 3 = 14 硬币。

+

马里奥收集了 1 + 10 + 0 + 3 = 14 硬币。

示例 2:

@@ -60,7 +60,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma

解释:

@@ -77,7 +77,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma

解释:

他总共收集了 2 + 3 = 5 硬币。

@@ -93,7 +93,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma

解释:

他总共获得了 9 + (-2) + 4 = 11 硬币。

@@ -109,7 +109,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3466.Ma

解释:

他总共获得了 -2 硬币。

diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index a7be119f93972..920ed9b103b60 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -310,7 +310,7 @@ | 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) | `数据库` | 困难 | | -| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README.md) | | 简单 | | +| 3465 | [查找具有有效序列号的产品](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README.md) | `数据库` | 简单 | | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index 344005f6e56e4..8bd58fa600a1d 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -308,7 +308,7 @@ Press Control + F(or Command + F on | 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) | `Database` | Hard | | -| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README_EN.md) | | Easy | | +| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README_EN.md) | `Database` | Easy | | ## Copyright diff --git a/solution/README.md b/solution/README.md index 870db42826621..d12af03081719 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3470,13 +3470,13 @@ | 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) | | 中等 | 🔒 | -| 3461 | [判断操作后字符串中的数字是否相等 I](/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README.md) | | 简单 | 第 438 场周赛 | -| 3462 | [提取至多 K 个元素的最大总和](/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README.md) | | 中等 | 第 438 场周赛 | -| 3463 | [判断操作后字符串中的数字是否相等 II](/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README.md) | | 困难 | 第 438 场周赛 | -| 3464 | [正方形上的点之间的最大距离](/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README.md) | | 困难 | 第 438 场周赛 | -| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README.md) | | 简单 | | -| 3466 | [最大硬币收藏量](/solution/3400-3499/3466.Maximum%20Coin%20Collection/README.md) | | 中等 | 🔒 | +| 3460 | [最多删除一次后的最长公共前缀](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README.md) | `双指针`,`字符串` | 中等 | 🔒 | +| 3461 | [判断操作后字符串中的数字是否相等 I](/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README.md) | `数学`,`字符串`,`组合数学`,`数论`,`模拟` | 简单 | 第 438 场周赛 | +| 3462 | [提取至多 K 个元素的最大总和](/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README.md) | `贪心`,`数组`,`矩阵`,`排序`,`堆(优先队列)` | 中等 | 第 438 场周赛 | +| 3463 | [判断操作后字符串中的数字是否相等 II](/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README.md) | `数学`,`字符串`,`组合数学`,`数论` | 困难 | 第 438 场周赛 | +| 3464 | [正方形上的点之间的最大距离](/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README.md) | `贪心`,`数组`,`二分查找` | 困难 | 第 438 场周赛 | +| 3465 | [查找具有有效序列号的产品](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README.md) | `数据库` | 简单 | | +| 3466 | [最大硬币收集量](/solution/3400-3499/3466.Maximum%20Coin%20Collection/README.md) | | 中等 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 10774975fd677..85ab0cbe2b02b 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3468,12 +3468,12 @@ Press Control + F(or Command + F on | 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 | 🔒 | -| 3461 | [Check If Digits Are Equal in String After Operations I](/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README_EN.md) | | Easy | Weekly Contest 438 | -| 3462 | [Maximum Sum With at Most K Elements](/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README_EN.md) | | Medium | Weekly Contest 438 | -| 3463 | [Check If Digits Are Equal in String After Operations II](/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README_EN.md) | | Hard | Weekly Contest 438 | -| 3464 | [Maximize the Distance Between Points on a Square](/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README_EN.md) | | Hard | Weekly Contest 438 | -| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README_EN.md) | | Easy | | +| 3460 | [Longest Common Prefix After at Most One Removal](/solution/3400-3499/3460.Longest%20Common%20Prefix%20After%20at%20Most%20One%20Removal/README_EN.md) | `Two Pointers`,`String` | Medium | 🔒 | +| 3461 | [Check If Digits Are Equal in String After Operations I](/solution/3400-3499/3461.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20I/README_EN.md) | `Math`,`String`,`Combinatorics`,`Number Theory`,`Simulation` | Easy | Weekly Contest 438 | +| 3462 | [Maximum Sum With at Most K Elements](/solution/3400-3499/3462.Maximum%20Sum%20With%20at%20Most%20K%20Elements/README_EN.md) | `Greedy`,`Array`,`Matrix`,`Sorting`,`Heap (Priority Queue)` | Medium | Weekly Contest 438 | +| 3463 | [Check If Digits Are Equal in String After Operations II](/solution/3400-3499/3463.Check%20If%20Digits%20Are%20Equal%20in%20String%20After%20Operations%20II/README_EN.md) | `Math`,`String`,`Combinatorics`,`Number Theory` | Hard | Weekly Contest 438 | +| 3464 | [Maximize the Distance Between Points on a Square](/solution/3400-3499/3464.Maximize%20the%20Distance%20Between%20Points%20on%20a%20Square/README_EN.md) | `Greedy`,`Array`,`Binary Search` | Hard | Weekly Contest 438 | +| 3465 | [Find Products with Valid Serial Numbers](/solution/3400-3499/3465.Find%20Products%20with%20Valid%20Serial%20Numbers/README_EN.md) | `Database` | Easy | | | 3466 | [Maximum Coin Collection](/solution/3400-3499/3466.Maximum%20Coin%20Collection/README_EN.md) | | Medium | 🔒 | ## Copyright