From 93e7fdf766fc57154f97ca90f8f99d1558182895 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Tue, 24 Sep 2024 09:39:15 +0800 Subject: [PATCH] feat: update lc problems --- .../1246.Palindrome Removal/README.md | 29 ++++++++++++++++++ .../1246.Palindrome Removal/README_EN.md | 29 ++++++++++++++++++ .../1246.Palindrome Removal/Solution.ts | 24 +++++++++++++++ .../README.md | 28 +++++++++++++++-- .../README_EN.md | 30 ++++++++++++++++--- .../Solution.ts | 17 +++++++++++ .../README.md | 12 ++++++++ .../README_EN.md | 12 ++++++++ .../Solution.ts | 7 +++++ .../README.md | 4 +++ .../README_EN.md | 4 +++ .../3295.Report Spam Message/README.md | 4 +++ .../3295.Report Spam Message/README_EN.md | 4 +++ .../README.md | 4 +++ .../README_EN.md | 4 +++ .../README.md | 4 +++ .../README_EN.md | 4 +++ .../README.md | 4 +++ .../README_EN.md | 4 +++ solution/README.md | 10 +++---- solution/README_EN.md | 10 +++---- 21 files changed, 231 insertions(+), 17 deletions(-) create mode 100644 solution/1200-1299/1246.Palindrome Removal/Solution.ts create mode 100644 solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/Solution.ts create mode 100644 solution/1200-1299/1250.Check If It Is a Good Array/Solution.ts diff --git a/solution/1200-1299/1246.Palindrome Removal/README.md b/solution/1200-1299/1246.Palindrome Removal/README.md index 2626a3b59ab2d..cfa57d851b221 100644 --- a/solution/1200-1299/1246.Palindrome Removal/README.md +++ b/solution/1200-1299/1246.Palindrome Removal/README.md @@ -181,6 +181,35 @@ func minimumMoves(arr []int) int { } ``` +#### TypeScript + +```ts +function minimumMoves(arr: number[]): number { + const n = arr.length; + const f: number[][] = Array.from({ length: n }, () => Array(n).fill(0)); + + for (let i = 0; i < n; ++i) { + f[i][i] = 1; + } + + for (let i = n - 2; i >= 0; --i) { + for (let j = i + 1; j < n; ++j) { + if (i + 1 === j) { + f[i][j] = arr[i] === arr[j] ? 1 : 2; + } else { + let t = arr[i] === arr[j] ? f[i + 1][j - 1] : Infinity; + for (let k = i; k < j; ++k) { + t = Math.min(t, f[i][k] + f[k + 1][j]); + } + f[i][j] = t; + } + } + } + + return f[0][n - 1]; +} +``` + diff --git a/solution/1200-1299/1246.Palindrome Removal/README_EN.md b/solution/1200-1299/1246.Palindrome Removal/README_EN.md index d8f63487348aa..b169a798eb766 100644 --- a/solution/1200-1299/1246.Palindrome Removal/README_EN.md +++ b/solution/1200-1299/1246.Palindrome Removal/README_EN.md @@ -181,6 +181,35 @@ func minimumMoves(arr []int) int { } ``` +#### TypeScript + +```ts +function minimumMoves(arr: number[]): number { + const n = arr.length; + const f: number[][] = Array.from({ length: n }, () => Array(n).fill(0)); + + for (let i = 0; i < n; ++i) { + f[i][i] = 1; + } + + for (let i = n - 2; i >= 0; --i) { + for (let j = i + 1; j < n; ++j) { + if (i + 1 === j) { + f[i][j] = arr[i] === arr[j] ? 1 : 2; + } else { + let t = arr[i] === arr[j] ? f[i + 1][j - 1] : Infinity; + for (let k = i; k < j; ++k) { + t = Math.min(t, f[i][k] + f[k + 1][j]); + } + f[i][j] = t; + } + } + } + + return f[0][n - 1]; +} +``` + diff --git a/solution/1200-1299/1246.Palindrome Removal/Solution.ts b/solution/1200-1299/1246.Palindrome Removal/Solution.ts new file mode 100644 index 0000000000000..4e9f549083049 --- /dev/null +++ b/solution/1200-1299/1246.Palindrome Removal/Solution.ts @@ -0,0 +1,24 @@ +function minimumMoves(arr: number[]): number { + const n = arr.length; + const f: number[][] = Array.from({ length: n }, () => Array(n).fill(0)); + + for (let i = 0; i < n; ++i) { + f[i][i] = 1; + } + + for (let i = n - 2; i >= 0; --i) { + for (let j = i + 1; j < n; ++j) { + if (i + 1 === j) { + f[i][j] = arr[i] === arr[j] ? 1 : 2; + } else { + let t = arr[i] === arr[j] ? f[i + 1][j - 1] : Infinity; + for (let k = i; k < j; ++k) { + t = Math.min(t, f[i][k] + f[k + 1][j]); + } + f[i][j] = t; + } + } + } + + return f[0][n - 1]; +} diff --git a/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README.md b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README.md index e16383488a101..2ba21a3242217 100644 --- a/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README.md +++ b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README.md @@ -73,13 +73,13 @@ tags: ### 方法一:贪心 -根据题目描述,两个字符串 $s1$ 和 $s2$ 都只包含字符 $x$ 和 $y$,且长度相同,因此可以将 $s1$ 和 $s2$ 中的字符一一对应起来,即 $s1[i]$ 和 $s2[i]$。 +根据题目描述,两个字符串 $s_1$ 和 $s_2$ 都只包含字符 $x$ 和 $y$,且长度相同,因此可以将 $s_1$ 和 $s_2$ 中的字符一一对应起来,即 $s_1[i]$ 和 $s_2[i]$。 -如果 $s1[i] = s2[i]$,则不需要交换,直接跳过即可。如果 $s1[i] \neq s2[i]$,则需要交换,我们统计 $s1[i]$ 和 $s2[i]$ 的组合情况,即 $s1[i] = x$ 且 $s2[i] = y$ 的情况,记为 $xy$,对于 $s1[i] = y$ 且 $s2[i] = x$ 的情况,记为 $yx$。 +如果 $s_1[i] = s_2[i]$,则不需要交换,直接跳过即可。如果 $s_1[i] \neq s_2[i]$,则需要交换,我们统计 $s_1[i]$ 和 $s_2[i]$ 的组合情况,即 $s_1[i] = x$ 且 $s_2[i] = y$ 的情况,记为 $xy$,对于 $s_1[i] = y$ 且 $s_2[i] = x$ 的情况,记为 $yx$。 如果 $xy + yx$ 为奇数,则无法完成交换,返回 $-1$。如果 $xy + yx$ 为偶数,则需要交换的次数为 $\left \lfloor \frac{x}{2} \right \rfloor$ + $\left \lfloor \frac{y}{2} \right \rfloor$ + $xy \bmod{2}$ + $yx \bmod{2}$。 -时间复杂度 $O(n)$,其中 $n$ 为字符串 $s1$ 和 $s2$ 的长度。空间复杂度 $O(1)$。 +时间复杂度 $O(n)$,其中 $n$ 为字符串 $s_1$ 和 $s_2$ 的长度。空间复杂度 $O(1)$。 @@ -160,6 +160,28 @@ func minimumSwap(s1 string, s2 string) int { } ``` +#### TypeScript + +```ts +function minimumSwap(s1: string, s2: string): number { + let xy = 0, + yx = 0; + + for (let i = 0; i < s1.length; ++i) { + const a = s1[i], + b = s2[i]; + xy += a < b ? 1 : 0; + yx += a > b ? 1 : 0; + } + + if ((xy + yx) % 2 !== 0) { + return -1; + } + + return Math.floor(xy / 2) + Math.floor(yx / 2) + (xy % 2) + (yx % 2); +} +``` + #### JavaScript ```js diff --git a/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README_EN.md b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README_EN.md index 686cf7e181197..fed7c7c743270 100644 --- a/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README_EN.md +++ b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/README_EN.md @@ -67,13 +67,13 @@ Note that you cannot swap s1[0] and s1[1] to make s1 equal to "yx", ca ### Solution 1: Greedy -According to the problem description, both strings $s1$ and $s2$ only contain characters $x$ and $y$, and have the same length. Therefore, we can pair the characters in $s1$ and $s2$, i.e., $s1[i]$ and $s2[i]$. +According to the problem description, both strings $s_1$ and $s_2$ contain only the characters $x$ and $y$, and they have the same length. Therefore, we can match the characters in $s_1$ and $s_2$ one by one, i.e., $s_1[i]$ and $s_2[i]$. -If $s1[i] = s2[i]$, no swap is needed, and we can skip it. If $s1[i] \neq s2[i]$, a swap is needed. We count the combination of $s1[i]$ and $s2[i]$, i.e., the situation where $s1[i] = x$ and $s2[i] = y$, denoted as $xy$, and the situation where $s1[i] = y$ and $s2[i] = x$, denoted as $yx$. +If $s_1[i] = s_2[i]$, no swap is needed, and we can skip to the next character. If $s_1[i] \neq s_2[i]$, a swap is needed. We count the combinations of $s_1[i]$ and $s_2[i]$: if $s_1[i] = x$ and $s_2[i] = y$, we denote it as $xy$; if $s_1[i] = y$ and $s_2[i] = x$, we denote it as $yx$. -If $xy + yx$ is odd, the swap cannot be completed, and we return $-1$. If $xy + yx$ is even, the number of swaps needed is $\left \lfloor \frac{x}{2} \right \rfloor$ + $\left \lfloor \frac{y}{2} \right \rfloor$ + $xy \bmod{2}$ + $yx \bmod{2}$. +If $xy + yx$ is odd, it is impossible to complete the swaps, and we return $-1$. If $xy + yx$ is even, the number of swaps needed is $\left \lfloor \frac{xy}{2} \right \rfloor + \left \lfloor \frac{yx}{2} \right \rfloor + xy \bmod{2} + yx \bmod{2}$. -The time complexity is $O(n)$, where $n$ is the length of the strings $s1$ and $s2$. The space complexity is $O(1)$. +The time complexity is $O(n)$, where $n$ is the length of the strings $s_1$ and $s_2$. The space complexity is $O(1)$. @@ -154,6 +154,28 @@ func minimumSwap(s1 string, s2 string) int { } ``` +#### TypeScript + +```ts +function minimumSwap(s1: string, s2: string): number { + let xy = 0, + yx = 0; + + for (let i = 0; i < s1.length; ++i) { + const a = s1[i], + b = s2[i]; + xy += a < b ? 1 : 0; + yx += a > b ? 1 : 0; + } + + if ((xy + yx) % 2 !== 0) { + return -1; + } + + return Math.floor(xy / 2) + Math.floor(yx / 2) + (xy % 2) + (yx % 2); +} +``` + #### JavaScript ```js diff --git a/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/Solution.ts b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/Solution.ts new file mode 100644 index 0000000000000..a5384e19bcb28 --- /dev/null +++ b/solution/1200-1299/1247.Minimum Swaps to Make Strings Equal/Solution.ts @@ -0,0 +1,17 @@ +function minimumSwap(s1: string, s2: string): number { + let xy = 0, + yx = 0; + + for (let i = 0; i < s1.length; ++i) { + const a = s1[i], + b = s2[i]; + xy += a < b ? 1 : 0; + yx += a > b ? 1 : 0; + } + + if ((xy + yx) % 2 !== 0) { + return -1; + } + + return Math.floor(xy / 2) + Math.floor(yx / 2) + (xy % 2) + (yx % 2); +} diff --git a/solution/1200-1299/1250.Check If It Is a Good Array/README.md b/solution/1200-1299/1250.Check If It Is a Good Array/README.md index bbd798d2a0927..d62d034d5829b 100644 --- a/solution/1200-1299/1250.Check If It Is a Good Array/README.md +++ b/solution/1200-1299/1250.Check If It Is a Good Array/README.md @@ -137,6 +137,18 @@ func gcd(a, b int) int { } ``` +#### TypeScript + +```ts +function isGoodArray(nums: number[]): boolean { + return nums.reduce(gcd) === 1; +} + +function gcd(a: number, b: number): number { + return b === 0 ? a : gcd(b, a % b); +} +``` + diff --git a/solution/1200-1299/1250.Check If It Is a Good Array/README_EN.md b/solution/1200-1299/1250.Check If It Is a Good Array/README_EN.md index 10d14d1ed4d3d..a8d961425b08f 100644 --- a/solution/1200-1299/1250.Check If It Is a Good Array/README_EN.md +++ b/solution/1200-1299/1250.Check If It Is a Good Array/README_EN.md @@ -138,6 +138,18 @@ func gcd(a, b int) int { } ``` +#### TypeScript + +```ts +function isGoodArray(nums: number[]): boolean { + return nums.reduce(gcd) === 1; +} + +function gcd(a: number, b: number): number { + return b === 0 ? a : gcd(b, a % b); +} +``` + diff --git a/solution/1200-1299/1250.Check If It Is a Good Array/Solution.ts b/solution/1200-1299/1250.Check If It Is a Good Array/Solution.ts new file mode 100644 index 0000000000000..791cc98d1449b --- /dev/null +++ b/solution/1200-1299/1250.Check If It Is a Good Array/Solution.ts @@ -0,0 +1,7 @@ +function isGoodArray(nums: number[]): boolean { + return nums.reduce(gcd) === 1; +} + +function gcd(a: number, b: number): number { + return b === 0 ? a : gcd(b, a % b); +} diff --git a/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README.md b/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README.md index be9583b7acda2..65c16c6ad572c 100644 --- a/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README.md +++ b/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README.md +tags: + - 数组 + - 链表 + - 双向链表 --- diff --git a/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README_EN.md b/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README_EN.md index bbb603284b230..f468355fd173d 100644 --- a/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README_EN.md +++ b/solution/3200-3299/3294.Convert Doubly Linked List to Array II/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README_EN.md +tags: + - Array + - Linked List + - Doubly-Linked List --- diff --git a/solution/3200-3299/3295.Report Spam Message/README.md b/solution/3200-3299/3295.Report Spam Message/README.md index 4089257e03a32..a5a874b95d77d 100644 --- a/solution/3200-3299/3295.Report Spam Message/README.md +++ b/solution/3200-3299/3295.Report Spam Message/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3295.Report%20Spam%20Message/README.md +tags: + - 数组 + - 哈希表 + - 字符串 --- diff --git a/solution/3200-3299/3295.Report Spam Message/README_EN.md b/solution/3200-3299/3295.Report Spam Message/README_EN.md index 9416ed04ec76e..7628ec0d11625 100644 --- a/solution/3200-3299/3295.Report Spam Message/README_EN.md +++ b/solution/3200-3299/3295.Report Spam Message/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3295.Report%20Spam%20Message/README_EN.md +tags: + - Array + - Hash Table + - String --- diff --git a/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README.md b/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README.md index 5ae77257e4492..84190db3f3adf 100644 --- a/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README.md +++ b/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README.md +tags: + - 数组 + - 数学 + - 二分查找 --- diff --git a/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README_EN.md b/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README_EN.md index cfb8f07108932..773086bc76e27 100644 --- a/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README_EN.md +++ b/solution/3200-3299/3296.Minimum Number of Seconds to Make Mountain Height Zero/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README_EN.md +tags: + - Array + - Math + - Binary Search --- diff --git a/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README.md b/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README.md index 8c353ff10c9ce..2de1808e6c3f7 100644 --- a/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README.md +++ b/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README.md +tags: + - 哈希表 + - 字符串 + - 滑动窗口 --- diff --git a/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README_EN.md b/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README_EN.md index eb701facde103..d3cf633e241db 100644 --- a/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README_EN.md +++ b/solution/3200-3299/3297.Count Substrings That Can Be Rearranged to Contain a String I/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README_EN.md +tags: + - Hash Table + - String + - Sliding Window --- diff --git a/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README.md b/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README.md index d967ecce0261c..40c4a9544da33 100644 --- a/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README.md +++ b/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README.md +tags: + - 哈希表 + - 字符串 + - 滑动窗口 --- diff --git a/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README_EN.md b/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README_EN.md index 730e56006eaa0..c56f9ee7217bf 100644 --- a/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README_EN.md +++ b/solution/3200-3299/3298.Count Substrings That Can Be Rearranged to Contain a String II/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README_EN.md +tags: + - Hash Table + - String + - Sliding Window --- diff --git a/solution/README.md b/solution/README.md index fde4c28974a61..78fe9d8fb8acf 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3304,11 +3304,11 @@ | 3291 | [形成目标字符串需要的最少字符串数 I](/solution/3200-3299/3291.Minimum%20Number%20of%20Valid%20Strings%20to%20Form%20Target%20I/README.md) | `字典树`,`线段树`,`数组`,`字符串`,`二分查找`,`动态规划`,`字符串匹配`,`哈希函数`,`滚动哈希` | 中等 | 第 415 场周赛 | | 3292 | [形成目标字符串需要的最少字符串数 II](/solution/3200-3299/3292.Minimum%20Number%20of%20Valid%20Strings%20to%20Form%20Target%20II/README.md) | `线段树`,`数组`,`字符串`,`二分查找`,`动态规划`,`字符串匹配`,`哈希函数`,`滚动哈希` | 困难 | 第 415 场周赛 | | 3293 | [计算产品最终价格](/solution/3200-3299/3293.Calculate%20Product%20Final%20Price/README.md) | `数据库` | 中等 | 🔒 | -| 3294 | [将双链表转换为数组 II](/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README.md) | | 中等 | 🔒 | -| 3295 | [举报垃圾信息](/solution/3200-3299/3295.Report%20Spam%20Message/README.md) | | 中等 | 第 416 场周赛 | -| 3296 | [移山所需的最少秒数](/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README.md) | | 中等 | 第 416 场周赛 | -| 3297 | [统计重新排列后包含另一个字符串的子字符串数目 I](/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README.md) | | 中等 | 第 416 场周赛 | -| 3298 | [统计重新排列后包含另一个字符串的子字符串数目 II](/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README.md) | | 困难 | 第 416 场周赛 | +| 3294 | [将双链表转换为数组 II](/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README.md) | `数组`,`链表`,`双向链表` | 中等 | 🔒 | +| 3295 | [举报垃圾信息](/solution/3200-3299/3295.Report%20Spam%20Message/README.md) | `数组`,`哈希表`,`字符串` | 中等 | 第 416 场周赛 | +| 3296 | [移山所需的最少秒数](/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README.md) | `数组`,`数学`,`二分查找` | 中等 | 第 416 场周赛 | +| 3297 | [统计重新排列后包含另一个字符串的子字符串数目 I](/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README.md) | `哈希表`,`字符串`,`滑动窗口` | 中等 | 第 416 场周赛 | +| 3298 | [统计重新排列后包含另一个字符串的子字符串数目 II](/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README.md) | `哈希表`,`字符串`,`滑动窗口` | 困难 | 第 416 场周赛 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index d25aa48ccc9d8..92a4abf9bf885 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3302,11 +3302,11 @@ Press Control + F(or Command + F on | 3291 | [Minimum Number of Valid Strings to Form Target I](/solution/3200-3299/3291.Minimum%20Number%20of%20Valid%20Strings%20to%20Form%20Target%20I/README_EN.md) | `Trie`,`Segment Tree`,`Array`,`String`,`Binary Search`,`Dynamic Programming`,`String Matching`,`Hash Function`,`Rolling Hash` | Medium | Weekly Contest 415 | | 3292 | [Minimum Number of Valid Strings to Form Target II](/solution/3200-3299/3292.Minimum%20Number%20of%20Valid%20Strings%20to%20Form%20Target%20II/README_EN.md) | `Segment Tree`,`Array`,`String`,`Binary Search`,`Dynamic Programming`,`String Matching`,`Hash Function`,`Rolling Hash` | Hard | Weekly Contest 415 | | 3293 | [Calculate Product Final Price](/solution/3200-3299/3293.Calculate%20Product%20Final%20Price/README_EN.md) | `Database` | Medium | 🔒 | -| 3294 | [Convert Doubly Linked List to Array II](/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README_EN.md) | | Medium | 🔒 | -| 3295 | [Report Spam Message](/solution/3200-3299/3295.Report%20Spam%20Message/README_EN.md) | | Medium | Weekly Contest 416 | -| 3296 | [Minimum Number of Seconds to Make Mountain Height Zero](/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README_EN.md) | | Medium | Weekly Contest 416 | -| 3297 | [Count Substrings That Can Be Rearranged to Contain a String I](/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README_EN.md) | | Medium | Weekly Contest 416 | -| 3298 | [Count Substrings That Can Be Rearranged to Contain a String II](/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README_EN.md) | | Hard | Weekly Contest 416 | +| 3294 | [Convert Doubly Linked List to Array II](/solution/3200-3299/3294.Convert%20Doubly%20Linked%20List%20to%20Array%20II/README_EN.md) | `Array`,`Linked List`,`Doubly-Linked List` | Medium | 🔒 | +| 3295 | [Report Spam Message](/solution/3200-3299/3295.Report%20Spam%20Message/README_EN.md) | `Array`,`Hash Table`,`String` | Medium | Weekly Contest 416 | +| 3296 | [Minimum Number of Seconds to Make Mountain Height Zero](/solution/3200-3299/3296.Minimum%20Number%20of%20Seconds%20to%20Make%20Mountain%20Height%20Zero/README_EN.md) | `Array`,`Math`,`Binary Search` | Medium | Weekly Contest 416 | +| 3297 | [Count Substrings That Can Be Rearranged to Contain a String I](/solution/3200-3299/3297.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20I/README_EN.md) | `Hash Table`,`String`,`Sliding Window` | Medium | Weekly Contest 416 | +| 3298 | [Count Substrings That Can Be Rearranged to Contain a String II](/solution/3200-3299/3298.Count%20Substrings%20That%20Can%20Be%20Rearranged%20to%20Contain%20a%20String%20II/README_EN.md) | `Hash Table`,`String`,`Sliding Window` | Hard | Weekly Contest 416 | ## Copyright