diff --git a/solution/0100-0199/0147.Insertion Sort List/README.md b/solution/0100-0199/0147.Insertion Sort List/README.md index f70899b2e4c3b..5f9c2b84a6d09 100644 --- a/solution/0100-0199/0147.Insertion Sort List/README.md +++ b/solution/0100-0199/0147.Insertion Sort List/README.md @@ -31,13 +31,13 @@ tags:

对链表进行插入排序。

-

+

 

示例 1:

-

+

 输入: head = [4,2,1,3]
@@ -45,7 +45,7 @@ tags:
 
 

示例 2:

-

+

 输入: head = [-1,5,3,4,0]
diff --git a/solution/0100-0199/0147.Insertion Sort List/images/1724130387-qxfMwx-Insertion-sort-example-300px.gif b/solution/0100-0199/0147.Insertion Sort List/images/1724130387-qxfMwx-Insertion-sort-example-300px.gif
new file mode 100644
index 0000000000000..96c1b12d5cc82
Binary files /dev/null and b/solution/0100-0199/0147.Insertion Sort List/images/1724130387-qxfMwx-Insertion-sort-example-300px.gif differ
diff --git a/solution/0100-0199/0147.Insertion Sort List/images/1724130414-QbPAjl-image.png b/solution/0100-0199/0147.Insertion Sort List/images/1724130414-QbPAjl-image.png
new file mode 100644
index 0000000000000..7b4b401c05391
Binary files /dev/null and b/solution/0100-0199/0147.Insertion Sort List/images/1724130414-QbPAjl-image.png differ
diff --git a/solution/0100-0199/0147.Insertion Sort List/images/1724130432-zoOvdI-image.png b/solution/0100-0199/0147.Insertion Sort List/images/1724130432-zoOvdI-image.png
new file mode 100644
index 0000000000000..af28294b1e9d5
Binary files /dev/null and b/solution/0100-0199/0147.Insertion Sort List/images/1724130432-zoOvdI-image.png differ
diff --git a/solution/0200-0299/0208.Implement Trie (Prefix Tree)/README.md b/solution/0200-0299/0208.Implement Trie (Prefix Tree)/README.md
index 76481c3da5923..76c12ffdbb115 100644
--- a/solution/0200-0299/0208.Implement Trie (Prefix Tree)/README.md	
+++ b/solution/0200-0299/0208.Implement Trie (Prefix Tree)/README.md	
@@ -19,7 +19,7 @@ tags:
 
 
 
-

Trie(发音类似 "try")或者说 前缀树 是一种树形数据结构,用于高效地存储和检索字符串数据集中的键。这一数据结构有相当多的应用情景,例如自动补完和拼写检查。

+

Trie(发音类似 "try")或者说 前缀树 是一种树形数据结构,用于高效地存储和检索字符串数据集中的键。这一数据结构有相当多的应用情景,例如自动补全和拼写检查。

请你实现 Trie 类:

@@ -27,10 +27,10 @@ tags:
  • Trie() 初始化前缀树对象。
  • void insert(String word) 向前缀树中插入字符串 word
  • boolean search(String word) 如果字符串 word 在前缀树中,返回 true(即,在检索之前已经插入);否则,返回 false
  • -
  • boolean startsWith(String prefix) 如果之前已经插入的字符串 word 的前缀之一为 prefix ,返回 true ;否则,返回 false
  • +
  • boolean startsWith(String prefix) 如果之前已经插入的字符串 word 的前缀之一为 prefix ,返回 true ;否则,返回 false
  • -

     

    +

     

    示例:

    @@ -51,12 +51,12 @@ trie.insert("app"); trie.search("app"); // 返回 True
    -

     

    +

     

    提示:

    diff --git a/solution/0300-0399/0379.Design Phone Directory/README.md b/solution/0300-0399/0379.Design Phone Directory/README.md index 1b671e581f3d3..02ffb8f3b06a3 100644 --- a/solution/0300-0399/0379.Design Phone Directory/README.md +++ b/solution/0300-0399/0379.Design Phone Directory/README.md @@ -20,41 +20,37 @@ tags: -

    设计一个电话目录管理系统,让它支持以下功能:

    +

    设计一个电话目录管理系统,一开始有 maxNumbers 个位置能够储存号码。系统应该存储号码,检查某个位置是否为空,并清空给定的位置。

    -
      -
    1. get: 分配给用户一个未被使用的电话号码,获取失败请返回 -1
    2. -
    3. check: 检查指定的电话号码是否被使用
    4. -
    5. release: 释放掉一个电话号码,使其能够重新被分配
    6. -
    +

    实现 PhoneDirectory 类:

    -

     

    - -

    示例:

    - -
    // 初始化电话目录,包括 3 个电话号码:0,1 和 2。
    -PhoneDirectory directory = new PhoneDirectory(3);
    -
    -// 可以返回任意未分配的号码,这里我们假设它返回 0。
    -directory.get();
    -
    -// 假设,函数返回 1。
    -directory.get();
    -
    -// 号码 2 未分配,所以返回为 true。
    -directory.check(2);
    -
    -// 返回 2,分配后,只剩一个号码未被分配。
    -directory.get();
    -
    -// 此时,号码 2 已经被分配,所以返回 false。
    -directory.check(2);
    +
     
    -// 释放号码 2,将该号码变回未分配状态。
    -directory.release(2);
    +

     

    -// 号码 2 现在是未分配状态,所以返回 true。 -directory.check(2); +

    示例 1:

    + +
    +输入:
    +["PhoneDirectory", "get", "get", "check", "get", "check", "release", "check"]
    +[[3], [], [], [2], [], [2], [2], [2]]
    +输出:
    +[null, 0, 1, true, 2, false, null, true]
    +
    +解释:
    +PhoneDirectory phoneDirectory = new PhoneDirectory(3);
    +phoneDirectory.get();      // 它可以返回任意可用的数字。这里我们假设它返回 0。
    +phoneDirectory.get();      // 假设它返回 1。
    +phoneDirectory.check(2);   // 数字 2 可用,所以返回 true。
    +phoneDirectory.get();      // 返回剩下的唯一一个数字 2。
    +phoneDirectory.check(2);   // 数字 2 不再可用,所以返回 false。
    +phoneDirectory.release(2); // 将数字 2 释放回号码池。
    +phoneDirectory.check(2);   // 数字 2 重新可用,返回 true。
     

     

    @@ -62,9 +58,9 @@ directory.check(2);

    提示:

    diff --git a/solution/0300-0399/0391.Perfect Rectangle/README.md b/solution/0300-0399/0391.Perfect Rectangle/README.md index c69b02149e247..0292de82c3f31 100644 --- a/solution/0300-0399/0391.Perfect Rectangle/README.md +++ b/solution/0300-0399/0391.Perfect Rectangle/README.md @@ -51,7 +51,8 @@ tags: diff --git a/solution/0300-0399/0391.Perfect Rectangle/README_EN.md b/solution/0300-0399/0391.Perfect Rectangle/README_EN.md index f10a51d190283..6c770c7548d75 100644 --- a/solution/0300-0399/0391.Perfect Rectangle/README_EN.md +++ b/solution/0300-0399/0391.Perfect Rectangle/README_EN.md @@ -52,7 +52,8 @@ tags: diff --git a/solution/0600-0699/0616.Add Bold Tag in String/README_EN.md b/solution/0600-0699/0616.Add Bold Tag in String/README_EN.md index 46ddc02925e25..e369b1612c0de 100644 --- a/solution/0600-0699/0616.Add Bold Tag in String/README_EN.md +++ b/solution/0600-0699/0616.Add Bold Tag in String/README_EN.md @@ -66,7 +66,7 @@ Since now the four <b>'s are consecutive, we merge them: "<b&g

     

    -

    Note: This question is the same as 758: https://leetcode.com/problems/bold-words-in-string/

    +

    Note: This question is the same as 758. Bold Words in String.

    diff --git a/solution/0700-0799/0756.Pyramid Transition Matrix/README.md b/solution/0700-0799/0756.Pyramid Transition Matrix/README.md index d36c3fa612034..edc215cc36bfd 100644 --- a/solution/0700-0799/0756.Pyramid Transition Matrix/README.md +++ b/solution/0700-0799/0756.Pyramid Transition Matrix/README.md @@ -26,9 +26,9 @@ tags:
  • 例如,"ABC" 表示一个三角形图案,其中一个 “C” 块堆叠在一个 'A' 块(左)和一个 'B' 块(右)之上。请注意,这与 "BAC" 不同,"B" 在左下角,"A" 在右下角。
  • -

    你从底部的一排积木 bottom 开始,作为一个单一的字符串,你 必须 使用作为金字塔的底部。

    +

    你从作为单个字符串给出的底部的一排积木 bottom 开始,必须 将其作为金字塔的底部。

    -

    在给定 bottom 和 allowed 的情况下,如果你能一直构建到金字塔顶部,使金字塔中的 每个三角形图案 都是允许的,则返回 true ,否则返回 false

    +

    在给定 bottom 和 allowed 的情况下,如果你能一直构建到金字塔顶部,使金字塔中的 每个三角形图案 都是在 allowed 中的,则返回 true ,否则返回 false

     

    @@ -39,7 +39,7 @@ tags:
     输入:bottom = "BCD", allowed = ["BCC","CDE","CEA","FFF"]
     输出:true
    -解释:允许的三角形模式显示在右边。
    +解释:允许的三角形图案显示在右边。
     从最底层(第 3 层)开始,我们可以在第 2 层构建“CE”,然后在第 1 层构建“E”。
     金字塔中有三种三角形图案,分别是 “BCC”、“CDE” 和 “CEA”。都是允许的。
     
    @@ -51,8 +51,8 @@ tags:
     输入:bottom = "AAAA", allowed = ["AAB","AAC","BCD","BBE","DEF"]
     输出:false
    -解释:允许的三角形模式显示在右边。
    -从最底层(游戏邦注:即第 4 个关卡)开始,创造第 3 个关卡有多种方法,但如果尝试所有可能性,你便会在创造第 1 个关卡前陷入困境。
    +解释:允许的三角形图案显示在右边。
    +从最底层(即第 4 层)开始,创造第 3 层有多种方法,但如果尝试所有可能性,你便会在创造第 1 层前陷入困境。
     

     

    diff --git a/solution/0700-0799/0758.Bold Words in String/README_EN.md b/solution/0700-0799/0758.Bold Words in String/README_EN.md index 0dc44c2004298..a2c3b2603d8f8 100644 --- a/solution/0700-0799/0758.Bold Words in String/README_EN.md +++ b/solution/0700-0799/0758.Bold Words in String/README_EN.md @@ -51,7 +51,7 @@ tags:

     

    -

    Note: This question is the same as 616: https://leetcode.com/problems/add-bold-tag-in-string/

    +

    Note: This question is the same as 616. Add Bold Tag in String.

    diff --git a/solution/1300-1399/1380.Lucky Numbers in a Matrix/README.md b/solution/1300-1399/1380.Lucky Numbers in a Matrix/README.md index 9e1179eaedd60..76443f36dd12a 100644 --- a/solution/1300-1399/1380.Lucky Numbers in a Matrix/README.md +++ b/solution/1300-1399/1380.Lucky Numbers in a Matrix/README.md @@ -19,7 +19,7 @@ tags: -

    给你一个 m * n 的矩阵,矩阵中的数字 各不相同 。请你按 任意 顺序返回矩阵中的所有幸运数。

    +

    给你一个 m x n 的矩阵,矩阵中的数字 各不相同 。请你按 任意 顺序返回矩阵中的所有幸运数。

    幸运数 是指矩阵中满足同时下列两个条件的元素:

    @@ -30,7 +30,7 @@ tags:

     

    -

    示例 1:

    +

    示例 1:

     输入:matrix = [[3,7,8],[9,11,13],[15,16,17]]
    @@ -38,7 +38,7 @@ tags:
     解释:15 是唯一的幸运数,因为它是其所在行中的最小值,也是所在列中的最大值。
     
    -

    示例 2:

    +

    示例 2:

     输入:matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
    @@ -46,12 +46,12 @@ tags:
     解释:12 是唯一的幸运数,因为它是其所在行中的最小值,也是所在列中的最大值。
     
    -

    示例 3:

    +

    示例 3:

     输入:matrix = [[7,8],[1,2]]
     输出:[7]
    -解释:7是唯一的幸运数字,因为它是行中的最小值,列中的最大值。
    +解释:7 是唯一的幸运数字,因为它是行中的最小值,列中的最大值。
     

     

    @@ -62,7 +62,7 @@ tags:
  • m == mat.length
  • n == mat[i].length
  • 1 <= n, m <= 50
  • -
  • 1 <= matrix[i][j] <= 10^5
  • +
  • 1 <= matrix[i][j] <= 105
  • 矩阵中的所有元素都是不同的
  • diff --git a/solution/1900-1999/1937.Maximum Number of Points with Cost/README.md b/solution/1900-1999/1937.Maximum Number of Points with Cost/README.md index 3d7c0c60e402c..b81992770f5bc 100644 --- a/solution/1900-1999/1937.Maximum Number of Points with Cost/README.md +++ b/solution/1900-1999/1937.Maximum Number of Points with Cost/README.md @@ -7,6 +7,7 @@ source: 第 250 场周赛 Q3 tags: - 数组 - 动态规划 + - 矩阵 --- diff --git a/solution/1900-1999/1937.Maximum Number of Points with Cost/README_EN.md b/solution/1900-1999/1937.Maximum Number of Points with Cost/README_EN.md index 94be6938d7f0a..f2ca388eb3cff 100644 --- a/solution/1900-1999/1937.Maximum Number of Points with Cost/README_EN.md +++ b/solution/1900-1999/1937.Maximum Number of Points with Cost/README_EN.md @@ -7,6 +7,7 @@ source: Weekly Contest 250 Q3 tags: - Array - Dynamic Programming + - Matrix --- diff --git a/solution/2100-2199/2122.Recover the Original Array/README.md b/solution/2100-2199/2122.Recover the Original Array/README.md index 958bb9fda7038..c23dc5f4956cd 100644 --- a/solution/2100-2199/2122.Recover the Original Array/README.md +++ b/solution/2100-2199/2122.Recover the Original Array/README.md @@ -7,6 +7,7 @@ source: 第 273 场周赛 Q4 tags: - 数组 - 哈希表 + - 双指针 - 枚举 - 排序 --- diff --git a/solution/2100-2199/2122.Recover the Original Array/README_EN.md b/solution/2100-2199/2122.Recover the Original Array/README_EN.md index b96a6c1b200ba..1e91a07ee2b4c 100644 --- a/solution/2100-2199/2122.Recover the Original Array/README_EN.md +++ b/solution/2100-2199/2122.Recover the Original Array/README_EN.md @@ -7,6 +7,7 @@ source: Weekly Contest 273 Q4 tags: - Array - Hash Table + - Two Pointers - Enumeration - Sorting --- diff --git a/solution/2300-2399/2324.Product Sales Analysis IV/README_EN.md b/solution/2300-2399/2324.Product Sales Analysis IV/README_EN.md index 0cb4d7d3160c7..980157a73f550 100644 --- a/solution/2300-2399/2324.Product Sales Analysis IV/README_EN.md +++ b/solution/2300-2399/2324.Product Sales Analysis IV/README_EN.md @@ -94,7 +94,7 @@ User 101: - Spent 7 * 15 = 105 on product 3. User 101 spent the most money on product 3. User 102: - - Spent (9 + 7) * 10 = 150 on product 1. + - Spent (9 + 6) * 10 = 150 on product 1. - Spent 6 * 25 = 150 on product 2. - Spent 10 * 15 = 150 on product 3. User 102 spent the most money on products 1, 2, and 3. diff --git a/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README.md b/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README.md index dbf5509786a4e..c12c29a77c75f 100644 --- a/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README.md +++ b/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README.md @@ -3,9 +3,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README.md tags: + - 栈 - 数组 - - 哈希表 - 排序 + - 单调栈 --- diff --git a/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README_EN.md b/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README_EN.md index e105f445388c4..ade4347e4ff3e 100644 --- a/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README_EN.md +++ b/solution/2800-2899/2863.Maximum Length of Semi-Decreasing Subarrays/README_EN.md @@ -3,9 +3,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README_EN.md tags: + - Stack - Array - - Hash Table - Sorting + - Monotonic Stack --- diff --git a/solution/2900-2999/2992.Number of Self-Divisible Permutations/README.md b/solution/2900-2999/2992.Number of Self-Divisible Permutations/README.md index 4aad8e74116f9..b87df04d77b9d 100644 --- a/solution/2900-2999/2992.Number of Self-Divisible Permutations/README.md +++ b/solution/2900-2999/2992.Number of Self-Divisible Permutations/README.md @@ -4,9 +4,9 @@ difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README.md tags: - 位运算 - - 递归 - 数组 - 动态规划 + - 回溯 - 状态压缩 --- diff --git a/solution/2900-2999/2992.Number of Self-Divisible Permutations/README_EN.md b/solution/2900-2999/2992.Number of Self-Divisible Permutations/README_EN.md index e00b54a2c7e66..1f3deec3b736b 100644 --- a/solution/2900-2999/2992.Number of Self-Divisible Permutations/README_EN.md +++ b/solution/2900-2999/2992.Number of Self-Divisible Permutations/README_EN.md @@ -4,9 +4,9 @@ difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README_EN.md tags: - Bit Manipulation - - Recursion - Array - Dynamic Programming + - Backtracking - Bitmask --- diff --git a/solution/3200-3299/3229.Minimum Operations to Make Array Equal to Target/README.md b/solution/3200-3299/3229.Minimum Operations to Make Array Equal to Target/README.md index 97d1002d0ad32..b6254c4de823b 100644 --- a/solution/3200-3299/3229.Minimum Operations to Make Array Equal to Target/README.md +++ b/solution/3200-3299/3229.Minimum Operations to Make Array Equal to Target/README.md @@ -22,7 +22,7 @@ tags:

    给你两个长度相同的正整数数组 numstarget

    -

    在一次操作中,你可以选择 nums 的任何子数组,并将该子数组内的每个元素的值增加或减少 1。

    +

    在一次操作中,你可以选择 nums 的任何子数组,并将该子数组内的每个元素的值增加或减少 1。

    返回使 nums 数组变为 target 数组所需的 最少 操作次数。

    diff --git a/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README.md b/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README.md index b7a32c06fa19d..a601420ffda1e 100644 --- a/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README.md +++ b/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README.md @@ -54,7 +54,7 @@ tags:

    提示:

    diff --git a/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README_EN.md b/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README_EN.md index 91342e9a0b9e3..f294a17bc290f 100644 --- a/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README_EN.md +++ b/solution/3200-3299/3247.Number of Subsequences with Odd Sum/README_EN.md @@ -52,7 +52,7 @@ tags:

    Constraints:

    diff --git a/solution/3200-3299/3253.Construct String with Minimum Cost (Easy)/README.md b/solution/3200-3299/3253.Construct String with Minimum Cost (Easy)/README.md index 6fa7adf713e91..fc855a4c5b4f8 100644 --- a/solution/3200-3299/3253.Construct String with Minimum Cost (Easy)/README.md +++ b/solution/3200-3299/3253.Construct String with Minimum Cost (Easy)/README.md @@ -6,7 +6,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3253.Co -# [3253. Construct String with Minimum Cost (Easy) 🔒](https://leetcode.cn/problems/construct-string-with-minimum-cost-easy) +# [3253. 以最低成本构建字符串(简单) 🔒](https://leetcode.cn/problems/construct-string-with-minimum-cost-easy) [English Version](/solution/3200-3299/3253.Construct%20String%20with%20Minimum%20Cost%20%28Easy%29/README_EN.md) @@ -14,59 +14,61 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3253.Co -

    You are given a string target, an array of strings words, and an integer array costs, both arrays of the same length.

    +

    给定字符串 target,一个字符串数组 words 以及一个整数数组 costs,两个数组长度相同。

    -

    Imagine an empty string s.

    +

    想象一个空字符串 s

    -

    You can perform the following operation any number of times (including zero):

    +

    您可以执行以下操作任意次数(包括 ):

    -

    Return the minimum cost to make s equal to target. If it's not possible, return -1.

    +

    返回使 s 与 target 相等的 最小 开销。如果不可能做到,返回 -1。

     

    -

    Example 1:

    + +

    示例 1:

    -

    Input: target = "abcdef", words = ["abdef","abc","d","def","ef"], costs = [100,1,1,10,5]

    +

    输入:target = "abcdef", words = ["abdef","abc","d","def","ef"], costs = [100,1,1,10,5]

    -

    Output: 7

    +

    输出:7

    -

    Explanation:

    +

    解释:

    -

    The minimum cost can be achieved by performing the following operations:

    +

    通过执行以下操作可以实现最低开销:

      -
    • Select index 1 and append "abc" to s at a cost of 1, resulting in s = "abc".
    • -
    • Select index 2 and append "d" to s at a cost of 1, resulting in s = "abcd".
    • -
    • Select index 4 and append "ef" to s at a cost of 5, resulting in s = "abcdef".
    • +
    • 选择下标 1 然后以 1 的开销将 "abc" 添加到 s,得到 s = "abc"
    • +
    • 选择下标 2 然后以 1 的开销将 "d" 添加到 s,得到 s = "abcd"
    • +
    • 选择下标 4 然后以 5 的开销将 "ef" 添加到 s,得到 s = "abcdef"
    -

    Example 2:

    +

    示例 2:

    -

    Input: target = "aaaa", words = ["z","zz","zzz"], costs = [1,10,100]

    +

    输入:target = "aaaa", words = ["z","zz","zzz"], costs = [1,10,100]

    -

    Output: -1

    +

    输出:-1

    -

    Explanation:

    +

    解释:

    -

    It is impossible to make s equal to target, so we return -1.

    +

    不可能使 s 与 target 相等,所以我们返回 -1。

     

    -

    Constraints:

    + +

    提示:

    diff --git a/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README.md b/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README.md index 7bccf0c7baff4..5e0ed741c9664 100644 --- a/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README.md +++ b/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README.md +tags: + - 数组 + - 滑动窗口 --- diff --git a/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README_EN.md b/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README_EN.md index 01eb65c90612d..d14f9690c0677 100644 --- a/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README_EN.md +++ b/solution/3200-3299/3254.Find the Power of K-Size Subarrays I/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README_EN.md +tags: + - Array + - Sliding Window --- diff --git a/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README.md b/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README.md index b2112dc42e585..422c9cc3b87bd 100644 --- a/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README.md +++ b/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README.md +tags: + - 数组 + - 滑动窗口 --- diff --git a/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README_EN.md b/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README_EN.md index 2ff13994a4097..88568b364fafa 100644 --- a/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README_EN.md +++ b/solution/3200-3299/3255.Find the Power of K-Size Subarrays II/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README_EN.md +tags: + - Array + - Sliding Window --- diff --git a/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README.md b/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README.md index 5ea0394d5eb16..f6cfac2c53ddf 100644 --- a/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README.md +++ b/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README.md +tags: + - 数组 + - 动态规划 + - 枚举 + - 矩阵 --- diff --git a/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README_EN.md b/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README_EN.md index f731f10aed8a9..019630a4cf3c4 100644 --- a/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README_EN.md +++ b/solution/3200-3299/3256.Maximum Value Sum by Placing Three Rooks I/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README_EN.md +tags: + - Array + - Dynamic Programming + - Enumeration + - Matrix --- diff --git a/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README.md b/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README.md index 4275e0f063b65..7085075b244d8 100644 --- a/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README.md +++ b/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README.md +tags: + - 数组 + - 动态规划 + - 枚举 + - 矩阵 --- diff --git a/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README_EN.md b/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README_EN.md index 0ec53a3fb877c..8df098939619b 100644 --- a/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README_EN.md +++ b/solution/3200-3299/3257.Maximum Value Sum by Placing Three Rooks II/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README_EN.md +tags: + - Array + - Dynamic Programming + - Enumeration + - Matrix --- diff --git a/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README.md b/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README.md index ec9250c5d7b95..23858ac32a0a7 100644 --- a/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README.md +++ b/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README.md +tags: + - 字符串 + - 滑动窗口 --- diff --git a/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README_EN.md b/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README_EN.md index 6184ebfd23b1d..b307a649978fe 100644 --- a/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README_EN.md +++ b/solution/3200-3299/3258.Count Substrings That Satisfy K-Constraint I/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README_EN.md +tags: + - String + - Sliding Window --- diff --git a/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README.md b/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README.md index a67c4da79fa45..f3dd8d9e8023e 100644 --- a/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README.md +++ b/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README.md +tags: + - 数组 + - 动态规划 --- diff --git a/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README_EN.md b/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README_EN.md index 994ac6e608ab3..1a78c451360a3 100644 --- a/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README_EN.md +++ b/solution/3200-3299/3259.Maximum Energy Boost From Two Drinks/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README_EN.md +tags: + - Array + - Dynamic Programming --- diff --git a/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README.md b/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README.md index ef06880541506..7e841a3a1cd07 100644 --- a/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README.md +++ b/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README.md +tags: + - 贪心 + - 数学 + - 字符串 + - 动态规划 + - 数论 --- diff --git a/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README_EN.md b/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README_EN.md index 0101e9258ee87..c66da0f3ff631 100644 --- a/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README_EN.md +++ b/solution/3200-3299/3260.Find the Largest Palindrome Divisible by K/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README_EN.md +tags: + - Greedy + - Math + - String + - Dynamic Programming + - Number Theory --- diff --git a/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README.md b/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README.md index 424b72457134b..395d723ee3f9d 100644 --- a/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README.md +++ b/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README.md +tags: + - 数组 + - 字符串 + - 二分查找 + - 前缀和 + - 滑动窗口 --- diff --git a/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README_EN.md b/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README_EN.md index f5c8ec13944a7..5e6192606234e 100644 --- a/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README_EN.md +++ b/solution/3200-3299/3261.Count Substrings That Satisfy K-Constraint II/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README_EN.md +tags: + - Array + - String + - Binary Search + - Prefix Sum + - Sliding Window --- diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/README.md b/solution/3200-3299/3262.Find Overlapping Shifts/README.md new file mode 100644 index 0000000000000..d25d83995a4be --- /dev/null +++ b/solution/3200-3299/3262.Find Overlapping Shifts/README.md @@ -0,0 +1,179 @@ +--- +comments: true +difficulty: 中等 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md +tags: + - 数据库 +--- + + + +# [3262. Find Overlapping Shifts 🔒](https://leetcode.cn/problems/find-overlapping-shifts) + +[English Version](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md) + +## 题目描述 + + + +

    Table: EmployeeShifts

    + +
    ++------------------+---------+
    +| Column Name      | Type    |
    ++------------------+---------+
    +| employee_id      | int     |
    +| start_time       | time    |
    +| end_time         | time    |
    ++------------------+---------+
    +(employee_id, start_time) is the unique key for this table.
    +This table contains information about the shifts worked by employees, including the start and end times on a specific date.
    +
    + +

    Write a solution to count the number of overlapping shifts for each employee. Two shifts are considered overlapping if one shift’s end_time is later than another shift’s start_time.

    + +

    Return the result table ordered by employee_id in ascending order.

    + +

    The query result format is in the following example.

    + +

     

    +

    Example:

    + +
    +

    Input:

    + +

    EmployeeShifts table:

    + +
    ++-------------+------------+----------+
    +| employee_id | start_time | end_time |
    ++-------------+------------+----------+
    +| 1           | 08:00:00   | 12:00:00 |
    +| 1           | 11:00:00   | 15:00:00 |
    +| 1           | 14:00:00   | 18:00:00 |
    +| 2           | 09:00:00   | 17:00:00 |
    +| 2           | 16:00:00   | 20:00:00 |
    +| 3           | 10:00:00   | 12:00:00 |
    +| 3           | 13:00:00   | 15:00:00 |
    +| 3           | 16:00:00   | 18:00:00 |
    +| 4           | 08:00:00   | 10:00:00 |
    +| 4           | 09:00:00   | 11:00:00 |
    ++-------------+------------+----------+
    +
    + +

    Output:

    + +
    ++-------------+--------------------+
    +| employee_id | overlapping_shifts |
    ++-------------+--------------------+
    +| 1           | 2                  |
    +| 2           | 1                  |
    +| 4           | 1                  |
    ++-------------+--------------------+
    +
    + +

    Explanation:

    + +
      +
    • Employee 1 has 3 shifts: +
        +
      • 08:00:00 to 12:00:00
      • +
      • 11:00:00 to 15:00:00
      • +
      • 14:00:00 to 18:00:00
      • +
      + The first shift overlaps with the second, and the second overlaps with the third, resulting in 2 overlapping shifts.
    • +
    • Employee 2 has 2 shifts: +
        +
      • 09:00:00 to 17:00:00
      • +
      • 16:00:00 to 20:00:00
      • +
      + These shifts overlap with each other, resulting in 1 overlapping shift.
    • +
    • Employee 3 has 3 shifts: +
        +
      • 10:00:00 to 12:00:00
      • +
      • 13:00:00 to 15:00:00
      • +
      • 16:00:00 to 18:00:00
      • +
      + None of these shifts overlap, so Employee 3 is not included in the output.
    • +
    • Employee 4 has 2 shifts: +
        +
      • 08:00:00 to 10:00:00
      • +
      • 09:00:00 to 11:00:00
      • +
      + These shifts overlap with each other, resulting in 1 overlapping shift.
    • +
    + +

    The output shows the employee_id and the count of overlapping shifts for each employee who has at least one overlapping shift, ordered by employee_id in ascending order.

    +
    + + + +## 解法 + + + +### 方法一:自连接 + 分组计数 + +我们首先使用自连接,将 `EmployeeShifts` 表连接自身。通过连接条件,确保只比较同一个员工的班次,并且检查班次之间是否存在重叠。 + +1. `t1.start_time < t2.end_time`:确保第一个班次的开始时间早于第二个班次的结束时间。 +1. `t1.end_time > t2.start_time`:确保第一个班次的结束时间晚于第二个班次的开始时间。 +1. `t1.start_time != t2.start_time`:避免班次与自身比较。 + +接下来,我们对数据按照 `employee_id` 进行分组,统计每个员工的重叠班次数量。这里我们将重叠班次数量除以 2,因为我们在自连接时,每个重叠的班次都会被计算两次。 + +最后,我们筛选出重叠班次数量大于 0 的员工,并按照 `employee_id` 进行升序排序。 + + + +#### MySQL + +```sql +SELECT + t1.employee_id, + COUNT(*) / 2 AS overlapping_shifts +FROM + EmployeeShifts t1 + JOIN EmployeeShifts t2 + ON t1.employee_id = t2.employee_id + AND t1.start_time < t2.end_time + AND t1.end_time > t2.start_time + AND t1.start_time != t2.start_time +GROUP BY 1 +HAVING overlapping_shifts > 0 +ORDER BY 1; +``` + +#### Pandas + +```python +import pandas as pd + + +def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: + merged = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_1", "_2") + ) + overlap = merged[ + (merged["start_time_1"] < merged["end_time_2"]) + & (merged["end_time_1"] > merged["start_time_2"]) + & (merged["start_time_1"] != merged["start_time_2"]) + ] + overlap_counts = ( + overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") + ) + overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 + result = ( + overlap_counts[overlap_counts["overlapping_shifts"] > 0] + .sort_values("employee_id") + .reset_index(drop=True) + ) + return result +``` + + + + + + diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md b/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md new file mode 100644 index 0000000000000..8ea50dd6938a4 --- /dev/null +++ b/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md @@ -0,0 +1,179 @@ +--- +comments: true +difficulty: Medium +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md +tags: + - Database +--- + + + +# [3262. Find Overlapping Shifts 🔒](https://leetcode.com/problems/find-overlapping-shifts) + +[中文文档](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) + +## Description + + + +

    Table: EmployeeShifts

    + +
    ++------------------+---------+
    +| Column Name      | Type    |
    ++------------------+---------+
    +| employee_id      | int     |
    +| start_time       | time    |
    +| end_time         | time    |
    ++------------------+---------+
    +(employee_id, start_time) is the unique key for this table.
    +This table contains information about the shifts worked by employees, including the start and end times on a specific date.
    +
    + +

    Write a solution to count the number of overlapping shifts for each employee. Two shifts are considered overlapping if one shift’s end_time is later than another shift’s start_time.

    + +

    Return the result table ordered by employee_id in ascending order.

    + +

    The query result format is in the following example.

    + +

     

    +

    Example:

    + +
    +

    Input:

    + +

    EmployeeShifts table:

    + +
    ++-------------+------------+----------+
    +| employee_id | start_time | end_time |
    ++-------------+------------+----------+
    +| 1           | 08:00:00   | 12:00:00 |
    +| 1           | 11:00:00   | 15:00:00 |
    +| 1           | 14:00:00   | 18:00:00 |
    +| 2           | 09:00:00   | 17:00:00 |
    +| 2           | 16:00:00   | 20:00:00 |
    +| 3           | 10:00:00   | 12:00:00 |
    +| 3           | 13:00:00   | 15:00:00 |
    +| 3           | 16:00:00   | 18:00:00 |
    +| 4           | 08:00:00   | 10:00:00 |
    +| 4           | 09:00:00   | 11:00:00 |
    ++-------------+------------+----------+
    +
    + +

    Output:

    + +
    ++-------------+--------------------+
    +| employee_id | overlapping_shifts |
    ++-------------+--------------------+
    +| 1           | 2                  |
    +| 2           | 1                  |
    +| 4           | 1                  |
    ++-------------+--------------------+
    +
    + +

    Explanation:

    + +
      +
    • Employee 1 has 3 shifts: +
        +
      • 08:00:00 to 12:00:00
      • +
      • 11:00:00 to 15:00:00
      • +
      • 14:00:00 to 18:00:00
      • +
      + The first shift overlaps with the second, and the second overlaps with the third, resulting in 2 overlapping shifts.
    • +
    • Employee 2 has 2 shifts: +
        +
      • 09:00:00 to 17:00:00
      • +
      • 16:00:00 to 20:00:00
      • +
      + These shifts overlap with each other, resulting in 1 overlapping shift.
    • +
    • Employee 3 has 3 shifts: +
        +
      • 10:00:00 to 12:00:00
      • +
      • 13:00:00 to 15:00:00
      • +
      • 16:00:00 to 18:00:00
      • +
      + None of these shifts overlap, so Employee 3 is not included in the output.
    • +
    • Employee 4 has 2 shifts: +
        +
      • 08:00:00 to 10:00:00
      • +
      • 09:00:00 to 11:00:00
      • +
      + These shifts overlap with each other, resulting in 1 overlapping shift.
    • +
    + +

    The output shows the employee_id and the count of overlapping shifts for each employee who has at least one overlapping shift, ordered by employee_id in ascending order.

    +
    + + + +## Solutions + + + +### Solution 1: Self-Join + Group Count + +We start by using a self-join to join the `EmployeeShifts` table with itself. The join condition ensures that only shifts of the same employee are compared, and checks if there is any overlap between the shifts. + +1. `t1.start_time < t2.end_time`: Ensures that the start time of the first shift is earlier than the end time of the second shift. +2. `t1.end_time > t2.start_time`: Ensures that the end time of the first shift is later than the start time of the second shift. +3. `t1.start_time != t2.start_time`: Avoids comparing a shift with itself. + +Next, we group the data by `employee_id` and count the number of overlapping shifts for each employee. We divide the count by 2 because each overlap is counted twice in the self-join. + +Finally, we filter out employees with an overlapping shift count greater than 0 and sort the results in ascending order by `employee_id`. + + + +#### MySQL + +```sql +SELECT + t1.employee_id, + COUNT(*) / 2 AS overlapping_shifts +FROM + EmployeeShifts t1 + JOIN EmployeeShifts t2 + ON t1.employee_id = t2.employee_id + AND t1.start_time < t2.end_time + AND t1.end_time > t2.start_time + AND t1.start_time != t2.start_time +GROUP BY 1 +HAVING overlapping_shifts > 0 +ORDER BY 1; +``` + +#### Pandas + +```python +import pandas as pd + + +def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: + merged = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_1", "_2") + ) + overlap = merged[ + (merged["start_time_1"] < merged["end_time_2"]) + & (merged["end_time_1"] > merged["start_time_2"]) + & (merged["start_time_1"] != merged["start_time_2"]) + ] + overlap_counts = ( + overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") + ) + overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 + result = ( + overlap_counts[overlap_counts["overlapping_shifts"] > 0] + .sort_values("employee_id") + .reset_index(drop=True) + ) + return result +``` + + + + + + diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py new file mode 100644 index 0000000000000..b670a8ad76853 --- /dev/null +++ b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py @@ -0,0 +1,22 @@ +import pandas as pd + + +def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: + merged = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_1", "_2") + ) + overlap = merged[ + (merged["start_time_1"] < merged["end_time_2"]) + & (merged["end_time_1"] > merged["start_time_2"]) + & (merged["start_time_1"] != merged["start_time_2"]) + ] + overlap_counts = ( + overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") + ) + overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 + result = ( + overlap_counts[overlap_counts["overlapping_shifts"] > 0] + .sort_values("employee_id") + .reset_index(drop=True) + ) + return result diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql new file mode 100644 index 0000000000000..fa5d404105bd7 --- /dev/null +++ b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql @@ -0,0 +1,13 @@ +SELECT + t1.employee_id, + COUNT(*) / 2 AS overlapping_shifts +FROM + EmployeeShifts t1 + JOIN EmployeeShifts t2 + ON t1.employee_id = t2.employee_id + AND t1.start_time < t2.end_time + AND t1.end_time > t2.start_time + AND t1.start_time != t2.start_time +GROUP BY 1 +HAVING overlapping_shifts > 0 +ORDER BY 1; diff --git a/solution/CONTEST_README.md b/solution/CONTEST_README.md index ca8a7957c7b8c..7d35115f978c7 100644 --- a/solution/CONTEST_README.md +++ b/solution/CONTEST_README.md @@ -2730,7 +2730,6 @@ comments: true #### 第 154 场周赛(2019-09-15 10:30, 90 分钟) 参赛人数 1299 -- [1189. “气球” 的最大数量](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README.md) - [1190. 反转每对括号间的子串](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README.md) - [1191. K 次串联后最大子数组之和](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README.md) - [1192. 查找集群内的关键连接](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README.md) diff --git a/solution/CONTEST_README_EN.md b/solution/CONTEST_README_EN.md index 4d933a032a96a..13ae499d2057a 100644 --- a/solution/CONTEST_README_EN.md +++ b/solution/CONTEST_README_EN.md @@ -2733,7 +2733,6 @@ If you want to estimate your score changes after the contest ends, you can visit #### Weekly Contest 154 -- [1189. Maximum Number of Balloons](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README_EN.md) - [1190. Reverse Substrings Between Each Pair of Parentheses](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README_EN.md) - [1191. K-Concatenation Maximum Sum](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README_EN.md) - [1192. Critical Connections in a Network](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README_EN.md) diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index 49c1a0ea51466..f2bdefbd30147 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -292,6 +292,7 @@ | 3236 | [首席执行官下属层级](/solution/3200-3299/3236.CEO%20Subordinate%20Hierarchy/README.md) | `数据库` | 困难 | 🔒 | | 3246 | [英超积分榜排名](/solution/3200-3299/3246.Premier%20League%20Table%20Ranking/README.md) | `数据库` | 简单 | 🔒 | | 3252 | [英超积分榜排名 II](/solution/3200-3299/3252.Premier%20League%20Table%20Ranking%20II/README.md) | `数据库` | 中等 | 🔒 | +| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index aa220ae281937..efacdc1632f09 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -290,6 +290,7 @@ Press Control + F(or Command + F on | 3236 | [CEO Subordinate Hierarchy](/solution/3200-3299/3236.CEO%20Subordinate%20Hierarchy/README_EN.md) | `Database` | Hard | 🔒 | | 3246 | [Premier League Table Ranking](/solution/3200-3299/3246.Premier%20League%20Table%20Ranking/README_EN.md) | `Database` | Easy | 🔒 | | 3252 | [Premier League Table Ranking II](/solution/3200-3299/3252.Premier%20League%20Table%20Ranking%20II/README_EN.md) | `Database` | Medium | 🔒 | +| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md) | | Medium | 🔒 | ## Copyright diff --git a/solution/README.md b/solution/README.md index 16a44f3ffa379..d98f0ecb11f7b 100644 --- a/solution/README.md +++ b/solution/README.md @@ -1199,7 +1199,6 @@ | 1186 | [删除一次得到子数组最大和](/solution/1100-1199/1186.Maximum%20Subarray%20Sum%20with%20One%20Deletion/README.md) | `数组`,`动态规划` | 中等 | 第 153 场周赛 | | 1187 | [使数组严格递增](/solution/1100-1199/1187.Make%20Array%20Strictly%20Increasing/README.md) | `数组`,`二分查找`,`动态规划`,`排序` | 困难 | 第 153 场周赛 | | 1188 | [设计有限阻塞队列](/solution/1100-1199/1188.Design%20Bounded%20Blocking%20Queue/README.md) | `多线程` | 中等 | 🔒 | -| 1189 | [“气球” 的最大数量](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README.md) | `哈希表`,`字符串`,`计数` | 简单 | 第 154 场周赛 | | 1190 | [反转每对括号间的子串](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README.md) | `栈`,`字符串` | 中等 | 第 154 场周赛 | | 1191 | [K 次串联后最大子数组之和](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README.md) | `数组`,`动态规划` | 中等 | 第 154 场周赛 | | 1192 | [查找集群内的关键连接](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README.md) | `深度优先搜索`,`图`,`双连通分量` | 困难 | 第 154 场周赛 | @@ -1947,7 +1946,7 @@ | 1934 | [确认率](/solution/1900-1999/1934.Confirmation%20Rate/README.md) | `数据库` | 中等 | | | 1935 | [可以输入的最大单词数](/solution/1900-1999/1935.Maximum%20Number%20of%20Words%20You%20Can%20Type/README.md) | `哈希表`,`字符串` | 简单 | 第 250 场周赛 | | 1936 | [新增的最少台阶数](/solution/1900-1999/1936.Add%20Minimum%20Number%20of%20Rungs/README.md) | `贪心`,`数组` | 中等 | 第 250 场周赛 | -| 1937 | [扣分后的最大得分](/solution/1900-1999/1937.Maximum%20Number%20of%20Points%20with%20Cost/README.md) | `数组`,`动态规划` | 中等 | 第 250 场周赛 | +| 1937 | [扣分后的最大得分](/solution/1900-1999/1937.Maximum%20Number%20of%20Points%20with%20Cost/README.md) | `数组`,`动态规划`,`矩阵` | 中等 | 第 250 场周赛 | | 1938 | [查询最大基因差](/solution/1900-1999/1938.Maximum%20Genetic%20Difference%20Query/README.md) | `位运算`,`深度优先搜索`,`字典树`,`数组`,`哈希表` | 困难 | 第 250 场周赛 | | 1939 | [主动请求确认消息的用户](/solution/1900-1999/1939.Users%20That%20Actively%20Request%20Confirmation%20Messages/README.md) | `数据库` | 简单 | 🔒 | | 1940 | [排序数组之间的最长公共子序列](/solution/1900-1999/1940.Longest%20Common%20Subsequence%20Between%20Sorted%20Arrays/README.md) | `数组`,`哈希表`,`计数` | 中等 | 🔒 | @@ -2132,7 +2131,7 @@ | 2119 | [反转两次的数字](/solution/2100-2199/2119.A%20Number%20After%20a%20Double%20Reversal/README.md) | `数学` | 简单 | 第 273 场周赛 | | 2120 | [执行所有后缀指令](/solution/2100-2199/2120.Execution%20of%20All%20Suffix%20Instructions%20Staying%20in%20a%20Grid/README.md) | `字符串`,`模拟` | 中等 | 第 273 场周赛 | | 2121 | [相同元素的间隔之和](/solution/2100-2199/2121.Intervals%20Between%20Identical%20Elements/README.md) | `数组`,`哈希表`,`前缀和` | 中等 | 第 273 场周赛 | -| 2122 | [还原原数组](/solution/2100-2199/2122.Recover%20the%20Original%20Array/README.md) | `数组`,`哈希表`,`枚举`,`排序` | 困难 | 第 273 场周赛 | +| 2122 | [还原原数组](/solution/2100-2199/2122.Recover%20the%20Original%20Array/README.md) | `数组`,`哈希表`,`双指针`,`枚举`,`排序` | 困难 | 第 273 场周赛 | | 2123 | [使矩阵中的 1 互不相邻的最小操作数](/solution/2100-2199/2123.Minimum%20Operations%20to%20Remove%20Adjacent%20Ones%20in%20Matrix/README.md) | `图`,`数组`,`矩阵` | 困难 | 🔒 | | 2124 | [检查是否所有 A 都在 B 之前](/solution/2100-2199/2124.Check%20if%20All%20A%27s%20Appears%20Before%20All%20B%27s/README.md) | `字符串` | 简单 | 第 274 场周赛 | | 2125 | [银行中的激光束数量](/solution/2100-2199/2125.Number%20of%20Laser%20Beams%20in%20a%20Bank/README.md) | `数组`,`数学`,`字符串`,`矩阵` | 中等 | 第 274 场周赛 | @@ -2873,7 +2872,7 @@ | 2860 | [让所有学生保持开心的分组方法数](/solution/2800-2899/2860.Happy%20Students/README.md) | `数组`,`枚举`,`排序` | 中等 | 第 363 场周赛 | | 2861 | [最大合金数](/solution/2800-2899/2861.Maximum%20Number%20of%20Alloys/README.md) | `数组`,`二分查找` | 中等 | 第 363 场周赛 | | 2862 | [完全子集的最大元素和](/solution/2800-2899/2862.Maximum%20Element-Sum%20of%20a%20Complete%20Subset%20of%20Indices/README.md) | `数组`,`数学`,`数论` | 困难 | 第 363 场周赛 | -| 2863 | [最长半递减数组](/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README.md) | `数组`,`哈希表`,`排序` | 中等 | 🔒 | +| 2863 | [最长半递减数组](/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README.md) | `栈`,`数组`,`排序`,`单调栈` | 中等 | 🔒 | | 2864 | [最大二进制奇数](/solution/2800-2899/2864.Maximum%20Odd%20Binary%20Number/README.md) | `贪心`,`数学`,`字符串` | 简单 | 第 364 场周赛 | | 2865 | [美丽塔 I](/solution/2800-2899/2865.Beautiful%20Towers%20I/README.md) | `栈`,`数组`,`单调栈` | 中等 | 第 364 场周赛 | | 2866 | [美丽塔 II](/solution/2800-2899/2866.Beautiful%20Towers%20II/README.md) | `栈`,`数组`,`单调栈` | 中等 | 第 364 场周赛 | @@ -3002,7 +3001,7 @@ | 2989 | [班级表现](/solution/2900-2999/2989.Class%20Performance/README.md) | `数据库` | 中等 | 🔒 | | 2990 | [贷款类型](/solution/2900-2999/2990.Loan%20Types/README.md) | `数据库` | 简单 | 🔒 | | 2991 | [最好的三家酒庄](/solution/2900-2999/2991.Top%20Three%20Wineries/README.md) | `数据库` | 困难 | 🔒 | -| 2992 | [自整除排列的数量](/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README.md) | `位运算`,`递归`,`数组`,`动态规划`,`状态压缩` | 中等 | 🔒 | +| 2992 | [自整除排列的数量](/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README.md) | `位运算`,`数组`,`动态规划`,`回溯`,`状态压缩` | 中等 | 🔒 | | 2993 | [发生在周五的交易 I](/solution/2900-2999/2993.Friday%20Purchases%20I/README.md) | `数据库` | 中等 | 🔒 | | 2994 | [发生在周五的交易 II](/solution/2900-2999/2994.Friday%20Purchases%20II/README.md) | `数据库` | 困难 | 🔒 | | 2995 | [观众变主播](/solution/2900-2999/2995.Viewers%20Turned%20Streamers/README.md) | `数据库` | 困难 | 🔒 | @@ -3263,15 +3262,16 @@ | 3250 | [单调数组对的数目 I](/solution/3200-3299/3250.Find%20the%20Count%20of%20Monotonic%20Pairs%20I/README.md) | `数组`,`数学`,`动态规划`,`组合数学`,`前缀和` | 困难 | 第 410 场周赛 | | 3251 | [单调数组对的数目 II](/solution/3200-3299/3251.Find%20the%20Count%20of%20Monotonic%20Pairs%20II/README.md) | `数组`,`数学`,`动态规划`,`组合数学`,`前缀和` | 困难 | 第 410 场周赛 | | 3252 | [英超积分榜排名 II](/solution/3200-3299/3252.Premier%20League%20Table%20Ranking%20II/README.md) | `数据库` | 中等 | 🔒 | -| 3253 | [Construct String with Minimum Cost (Easy)](/solution/3200-3299/3253.Construct%20String%20with%20Minimum%20Cost%20%28Easy%29/README.md) | | 中等 | 🔒 | -| 3254 | [长度为 K 的子数组的能量值 I](/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README.md) | | 中等 | 第 137 场双周赛 | -| 3255 | [长度为 K 的子数组的能量值 II](/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README.md) | | 中等 | 第 137 场双周赛 | -| 3256 | [放三个车的价值之和最大 I](/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README.md) | | 困难 | 第 137 场双周赛 | -| 3257 | [放三个车的价值之和最大 II](/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README.md) | | 困难 | 第 137 场双周赛 | -| 3258 | [统计满足 K 约束的子字符串数量 I](/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README.md) | | 简单 | 第 411 场周赛 | -| 3259 | [超级饮料的最大强化能量](/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README.md) | | 中等 | 第 411 场周赛 | -| 3260 | [找出最大的 N 位 K 回文数](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README.md) | | 困难 | 第 411 场周赛 | -| 3261 | [统计满足 K 约束的子字符串数量 II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README.md) | | 困难 | 第 411 场周赛 | +| 3253 | [以最低成本构建字符串(简单)](/solution/3200-3299/3253.Construct%20String%20with%20Minimum%20Cost%20%28Easy%29/README.md) | | 中等 | 🔒 | +| 3254 | [长度为 K 的子数组的能量值 I](/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README.md) | `数组`,`滑动窗口` | 中等 | 第 137 场双周赛 | +| 3255 | [长度为 K 的子数组的能量值 II](/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README.md) | `数组`,`滑动窗口` | 中等 | 第 137 场双周赛 | +| 3256 | [放三个车的价值之和最大 I](/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README.md) | `数组`,`动态规划`,`枚举`,`矩阵` | 困难 | 第 137 场双周赛 | +| 3257 | [放三个车的价值之和最大 II](/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README.md) | `数组`,`动态规划`,`枚举`,`矩阵` | 困难 | 第 137 场双周赛 | +| 3258 | [统计满足 K 约束的子字符串数量 I](/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README.md) | `字符串`,`滑动窗口` | 简单 | 第 411 场周赛 | +| 3259 | [超级饮料的最大强化能量](/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README.md) | `数组`,`动态规划` | 中等 | 第 411 场周赛 | +| 3260 | [找出最大的 N 位 K 回文数](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README.md) | `贪心`,`数学`,`字符串`,`动态规划`,`数论` | 困难 | 第 411 场周赛 | +| 3261 | [统计满足 K 约束的子字符串数量 II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README.md) | `数组`,`字符串`,`二分查找`,`前缀和`,`滑动窗口` | 困难 | 第 411 场周赛 | +| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index f7b1122cf8297..4ff2f3aefd7c6 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -1197,7 +1197,6 @@ Press Control + F(or Command + F on | 1186 | [Maximum Subarray Sum with One Deletion](/solution/1100-1199/1186.Maximum%20Subarray%20Sum%20with%20One%20Deletion/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 153 | | 1187 | [Make Array Strictly Increasing](/solution/1100-1199/1187.Make%20Array%20Strictly%20Increasing/README_EN.md) | `Array`,`Binary Search`,`Dynamic Programming`,`Sorting` | Hard | Weekly Contest 153 | | 1188 | [Design Bounded Blocking Queue](/solution/1100-1199/1188.Design%20Bounded%20Blocking%20Queue/README_EN.md) | `Concurrency` | Medium | 🔒 | -| 1189 | [Maximum Number of Balloons](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README_EN.md) | `Hash Table`,`String`,`Counting` | Easy | Weekly Contest 154 | | 1190 | [Reverse Substrings Between Each Pair of Parentheses](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README_EN.md) | `Stack`,`String` | Medium | Weekly Contest 154 | | 1191 | [K-Concatenation Maximum Sum](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 154 | | 1192 | [Critical Connections in a Network](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README_EN.md) | `Depth-First Search`,`Graph`,`Biconnected Component` | Hard | Weekly Contest 154 | @@ -1945,7 +1944,7 @@ Press Control + F(or Command + F on | 1934 | [Confirmation Rate](/solution/1900-1999/1934.Confirmation%20Rate/README_EN.md) | `Database` | Medium | | | 1935 | [Maximum Number of Words You Can Type](/solution/1900-1999/1935.Maximum%20Number%20of%20Words%20You%20Can%20Type/README_EN.md) | `Hash Table`,`String` | Easy | Weekly Contest 250 | | 1936 | [Add Minimum Number of Rungs](/solution/1900-1999/1936.Add%20Minimum%20Number%20of%20Rungs/README_EN.md) | `Greedy`,`Array` | Medium | Weekly Contest 250 | -| 1937 | [Maximum Number of Points with Cost](/solution/1900-1999/1937.Maximum%20Number%20of%20Points%20with%20Cost/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 250 | +| 1937 | [Maximum Number of Points with Cost](/solution/1900-1999/1937.Maximum%20Number%20of%20Points%20with%20Cost/README_EN.md) | `Array`,`Dynamic Programming`,`Matrix` | Medium | Weekly Contest 250 | | 1938 | [Maximum Genetic Difference Query](/solution/1900-1999/1938.Maximum%20Genetic%20Difference%20Query/README_EN.md) | `Bit Manipulation`,`Depth-First Search`,`Trie`,`Array`,`Hash Table` | Hard | Weekly Contest 250 | | 1939 | [Users That Actively Request Confirmation Messages](/solution/1900-1999/1939.Users%20That%20Actively%20Request%20Confirmation%20Messages/README_EN.md) | `Database` | Easy | 🔒 | | 1940 | [Longest Common Subsequence Between Sorted Arrays](/solution/1900-1999/1940.Longest%20Common%20Subsequence%20Between%20Sorted%20Arrays/README_EN.md) | `Array`,`Hash Table`,`Counting` | Medium | 🔒 | @@ -2130,7 +2129,7 @@ Press Control + F(or Command + F on | 2119 | [A Number After a Double Reversal](/solution/2100-2199/2119.A%20Number%20After%20a%20Double%20Reversal/README_EN.md) | `Math` | Easy | Weekly Contest 273 | | 2120 | [Execution of All Suffix Instructions Staying in a Grid](/solution/2100-2199/2120.Execution%20of%20All%20Suffix%20Instructions%20Staying%20in%20a%20Grid/README_EN.md) | `String`,`Simulation` | Medium | Weekly Contest 273 | | 2121 | [Intervals Between Identical Elements](/solution/2100-2199/2121.Intervals%20Between%20Identical%20Elements/README_EN.md) | `Array`,`Hash Table`,`Prefix Sum` | Medium | Weekly Contest 273 | -| 2122 | [Recover the Original Array](/solution/2100-2199/2122.Recover%20the%20Original%20Array/README_EN.md) | `Array`,`Hash Table`,`Enumeration`,`Sorting` | Hard | Weekly Contest 273 | +| 2122 | [Recover the Original Array](/solution/2100-2199/2122.Recover%20the%20Original%20Array/README_EN.md) | `Array`,`Hash Table`,`Two Pointers`,`Enumeration`,`Sorting` | Hard | Weekly Contest 273 | | 2123 | [Minimum Operations to Remove Adjacent Ones in Matrix](/solution/2100-2199/2123.Minimum%20Operations%20to%20Remove%20Adjacent%20Ones%20in%20Matrix/README_EN.md) | `Graph`,`Array`,`Matrix` | Hard | 🔒 | | 2124 | [Check if All A's Appears Before All B's](/solution/2100-2199/2124.Check%20if%20All%20A%27s%20Appears%20Before%20All%20B%27s/README_EN.md) | `String` | Easy | Weekly Contest 274 | | 2125 | [Number of Laser Beams in a Bank](/solution/2100-2199/2125.Number%20of%20Laser%20Beams%20in%20a%20Bank/README_EN.md) | `Array`,`Math`,`String`,`Matrix` | Medium | Weekly Contest 274 | @@ -2871,7 +2870,7 @@ Press Control + F(or Command + F on | 2860 | [Happy Students](/solution/2800-2899/2860.Happy%20Students/README_EN.md) | `Array`,`Enumeration`,`Sorting` | Medium | Weekly Contest 363 | | 2861 | [Maximum Number of Alloys](/solution/2800-2899/2861.Maximum%20Number%20of%20Alloys/README_EN.md) | `Array`,`Binary Search` | Medium | Weekly Contest 363 | | 2862 | [Maximum Element-Sum of a Complete Subset of Indices](/solution/2800-2899/2862.Maximum%20Element-Sum%20of%20a%20Complete%20Subset%20of%20Indices/README_EN.md) | `Array`,`Math`,`Number Theory` | Hard | Weekly Contest 363 | -| 2863 | [Maximum Length of Semi-Decreasing Subarrays](/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README_EN.md) | `Array`,`Hash Table`,`Sorting` | Medium | 🔒 | +| 2863 | [Maximum Length of Semi-Decreasing Subarrays](/solution/2800-2899/2863.Maximum%20Length%20of%20Semi-Decreasing%20Subarrays/README_EN.md) | `Stack`,`Array`,`Sorting`,`Monotonic Stack` | Medium | 🔒 | | 2864 | [Maximum Odd Binary Number](/solution/2800-2899/2864.Maximum%20Odd%20Binary%20Number/README_EN.md) | `Greedy`,`Math`,`String` | Easy | Weekly Contest 364 | | 2865 | [Beautiful Towers I](/solution/2800-2899/2865.Beautiful%20Towers%20I/README_EN.md) | `Stack`,`Array`,`Monotonic Stack` | Medium | Weekly Contest 364 | | 2866 | [Beautiful Towers II](/solution/2800-2899/2866.Beautiful%20Towers%20II/README_EN.md) | `Stack`,`Array`,`Monotonic Stack` | Medium | Weekly Contest 364 | @@ -3000,7 +2999,7 @@ Press Control + F(or Command + F on | 2989 | [Class Performance](/solution/2900-2999/2989.Class%20Performance/README_EN.md) | `Database` | Medium | 🔒 | | 2990 | [Loan Types](/solution/2900-2999/2990.Loan%20Types/README_EN.md) | `Database` | Easy | 🔒 | | 2991 | [Top Three Wineries](/solution/2900-2999/2991.Top%20Three%20Wineries/README_EN.md) | `Database` | Hard | 🔒 | -| 2992 | [Number of Self-Divisible Permutations](/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README_EN.md) | `Bit Manipulation`,`Recursion`,`Array`,`Dynamic Programming`,`Bitmask` | Medium | 🔒 | +| 2992 | [Number of Self-Divisible Permutations](/solution/2900-2999/2992.Number%20of%20Self-Divisible%20Permutations/README_EN.md) | `Bit Manipulation`,`Array`,`Dynamic Programming`,`Backtracking`,`Bitmask` | Medium | 🔒 | | 2993 | [Friday Purchases I](/solution/2900-2999/2993.Friday%20Purchases%20I/README_EN.md) | `Database` | Medium | 🔒 | | 2994 | [Friday Purchases II](/solution/2900-2999/2994.Friday%20Purchases%20II/README_EN.md) | `Database` | Hard | 🔒 | | 2995 | [Viewers Turned Streamers](/solution/2900-2999/2995.Viewers%20Turned%20Streamers/README_EN.md) | `Database` | Hard | 🔒 | @@ -3262,14 +3261,15 @@ Press Control + F(or Command + F on | 3251 | [Find the Count of Monotonic Pairs II](/solution/3200-3299/3251.Find%20the%20Count%20of%20Monotonic%20Pairs%20II/README_EN.md) | `Array`,`Math`,`Dynamic Programming`,`Combinatorics`,`Prefix Sum` | Hard | Weekly Contest 410 | | 3252 | [Premier League Table Ranking II](/solution/3200-3299/3252.Premier%20League%20Table%20Ranking%20II/README_EN.md) | `Database` | Medium | 🔒 | | 3253 | [Construct String with Minimum Cost (Easy)](/solution/3200-3299/3253.Construct%20String%20with%20Minimum%20Cost%20%28Easy%29/README_EN.md) | | Medium | 🔒 | -| 3254 | [Find the Power of K-Size Subarrays I](/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README_EN.md) | | Medium | Biweekly Contest 137 | -| 3255 | [Find the Power of K-Size Subarrays II](/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README_EN.md) | | Medium | Biweekly Contest 137 | -| 3256 | [Maximum Value Sum by Placing Three Rooks I](/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README_EN.md) | | Hard | Biweekly Contest 137 | -| 3257 | [Maximum Value Sum by Placing Three Rooks II](/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README_EN.md) | | Hard | Biweekly Contest 137 | -| 3258 | [Count Substrings That Satisfy K-Constraint I](/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README_EN.md) | | Easy | Weekly Contest 411 | -| 3259 | [Maximum Energy Boost From Two Drinks](/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README_EN.md) | | Medium | Weekly Contest 411 | -| 3260 | [Find the Largest Palindrome Divisible by K](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README_EN.md) | | Hard | Weekly Contest 411 | -| 3261 | [Count Substrings That Satisfy K-Constraint II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README_EN.md) | | Hard | Weekly Contest 411 | +| 3254 | [Find the Power of K-Size Subarrays I](/solution/3200-3299/3254.Find%20the%20Power%20of%20K-Size%20Subarrays%20I/README_EN.md) | `Array`,`Sliding Window` | Medium | Biweekly Contest 137 | +| 3255 | [Find the Power of K-Size Subarrays II](/solution/3200-3299/3255.Find%20the%20Power%20of%20K-Size%20Subarrays%20II/README_EN.md) | `Array`,`Sliding Window` | Medium | Biweekly Contest 137 | +| 3256 | [Maximum Value Sum by Placing Three Rooks I](/solution/3200-3299/3256.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20I/README_EN.md) | `Array`,`Dynamic Programming`,`Enumeration`,`Matrix` | Hard | Biweekly Contest 137 | +| 3257 | [Maximum Value Sum by Placing Three Rooks II](/solution/3200-3299/3257.Maximum%20Value%20Sum%20by%20Placing%20Three%20Rooks%20II/README_EN.md) | `Array`,`Dynamic Programming`,`Enumeration`,`Matrix` | Hard | Biweekly Contest 137 | +| 3258 | [Count Substrings That Satisfy K-Constraint I](/solution/3200-3299/3258.Count%20Substrings%20That%20Satisfy%20K-Constraint%20I/README_EN.md) | `String`,`Sliding Window` | Easy | Weekly Contest 411 | +| 3259 | [Maximum Energy Boost From Two Drinks](/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 411 | +| 3260 | [Find the Largest Palindrome Divisible by K](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README_EN.md) | `Greedy`,`Math`,`String`,`Dynamic Programming`,`Number Theory` | Hard | Weekly Contest 411 | +| 3261 | [Count Substrings That Satisfy K-Constraint II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README_EN.md) | `Array`,`String`,`Binary Search`,`Prefix Sum`,`Sliding Window` | Hard | Weekly Contest 411 | +| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md) | | Medium | 🔒 | ## Copyright