diff --git a/README.md b/README.md
index 8ebdd386d..2b3e02071 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,22 @@ LeetCode Problems' Solutions
| # | Title | Solution | Difficulty |
| :-: | - | - | :-: |
+| 1707 | [Maximum XOR With an Element From Array](https://leetcode.com/problems/maximum-xor-with-an-element-from-array "与数组中元素的最大异或值") | [Go](problems/maximum-xor-with-an-element-from-array) | Hard |
+| 1706 | [Where Will the Ball Fall](https://leetcode.com/problems/where-will-the-ball-fall "球会落何处") | [Go](problems/where-will-the-ball-fall) | Medium |
+| 1705 | [Maximum Number of Eaten Apples](https://leetcode.com/problems/maximum-number-of-eaten-apples "吃苹果的最大数目") | [Go](problems/maximum-number-of-eaten-apples) | Medium |
+| 1704 | [Determine if String Halves Are Alike](https://leetcode.com/problems/determine-if-string-halves-are-alike "判断字符串的两半是否相似") | [Go](problems/determine-if-string-halves-are-alike) | Easy |
+| 1703 | [Minimum Adjacent Swaps for K Consecutive Ones](https://leetcode.com/problems/minimum-adjacent-swaps-for-k-consecutive-ones "得到连续 K 个 1 的最少相邻交换次数") | [Go](problems/minimum-adjacent-swaps-for-k-consecutive-ones) | Hard |
+| 1702 | [Maximum Binary String After Change](https://leetcode.com/problems/maximum-binary-string-after-change "修改后的最大二进制字符串") | [Go](problems/maximum-binary-string-after-change) | Medium |
+| 1701 | [Average Waiting Time](https://leetcode.com/problems/average-waiting-time "平均等待时间") | [Go](problems/average-waiting-time) | Medium |
+| 1700 | [Number of Students Unable to Eat Lunch](https://leetcode.com/problems/number-of-students-unable-to-eat-lunch "无法吃午餐的学生数量") | [Go](problems/number-of-students-unable-to-eat-lunch) | Easy |
+| 1699 | [Number of Calls Between Two Persons](https://leetcode.com/problems/number-of-calls-between-two-persons) 🔒 | [MySQL](problems/number-of-calls-between-two-persons) | Medium |
+| 1698 | [Number of Distinct Substrings in a String](https://leetcode.com/problems/number-of-distinct-substrings-in-a-string) 🔒 | [Go](problems/number-of-distinct-substrings-in-a-string) | Medium |
+| 1697 | [Checking Existence of Edge Length Limited Paths](https://leetcode.com/problems/checking-existence-of-edge-length-limited-paths "检查边长度限制的路径是否存在") | [Go](problems/checking-existence-of-edge-length-limited-paths) | Hard |
+| 1696 | [Jump Game VI](https://leetcode.com/problems/jump-game-vi "跳跃游戏 VI") | [Go](problems/jump-game-vi) | Medium |
+| 1695 | [Maximum Erasure Value](https://leetcode.com/problems/maximum-erasure-value "删除子数组的最大得分") | [Go](problems/maximum-erasure-value) | Medium |
+| 1694 | [Reformat Phone Number](https://leetcode.com/problems/reformat-phone-number "重新格式化电话号码") | [Go](problems/reformat-phone-number) | Easy |
+| 1693 | [Daily Leads and Partners](https://leetcode.com/problems/daily-leads-and-partners) 🔒 | [MySQL](problems/daily-leads-and-partners) | Easy |
+| 1692 | [Count Ways to Distribute Candies](https://leetcode.com/problems/count-ways-to-distribute-candies) 🔒 | [Go](problems/count-ways-to-distribute-candies) | Hard |
| 1691 | [Maximum Height by Stacking Cuboids](https://leetcode.com/problems/maximum-height-by-stacking-cuboids "堆叠长方体的最大高度") | [Go](problems/maximum-height-by-stacking-cuboids) | Hard |
| 1690 | [Stone Game VII](https://leetcode.com/problems/stone-game-vii "石子游戏 VII") | [Go](problems/stone-game-vii) | Medium |
| 1689 | [Partitioning Into Minimum Number Of Deci-Binary Numbers](https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers "十-二进制数的最少数目") | [Go](problems/partitioning-into-minimum-number-of-deci-binary-numbers) | Medium |
diff --git a/problems/average-waiting-time/README.md b/problems/average-waiting-time/README.md
new file mode 100644
index 000000000..464b5a9ec
--- /dev/null
+++ b/problems/average-waiting-time/README.md
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+[< Previous](../number-of-students-unable-to-eat-lunch "Number of Students Unable to Eat Lunch")
+
+[Next >](../maximum-binary-string-after-change "Maximum Binary String After Change")
+
+## [1701. Average Waiting Time (Medium)](https://leetcode.com/problems/average-waiting-time "平均等待时间")
+
+
There is a restaurant with a single chef. You are given an array customers
, where customers[i] = [arrivali, timei]:
+
+
+ arrivali
is the arrival time of the ith
customer. The arrival times are sorted in non-decreasing order.
+ timei
is the time needed to prepare the order of the ith
customer.
+
+
+When a customer arrives, he gives the chef his order, and the chef starts preparing it once he is idle. The customer waits till the chef finishes preparing his order. The chef does not prepare food for more than one customer at a time. The chef prepares food for customers in the order they were given in the input.
+
+Return the average waiting time of all customers. Solutions within 10-5
from the actual answer are considered accepted.
+
+
+Example 1:
+
+
+Input: customers = [[1,2],[2,5],[4,3]]
+Output: 5.00000
+Explanation:
+1) The first customer arrives at time 1, the chef takes his order and starts preparing it immediately at time 1, and finishes at time 3, so the waiting time of the first customer is 3 - 1 = 2.
+2) The second customer arrives at time 2, the chef takes his order and starts preparing it at time 3, and finishes at time 8, so the waiting time of the second customer is 8 - 2 = 6.
+3) The third customer arrives at time 4, the chef takes his order and starts preparing it at time 8, and finishes at time 11, so the waiting time of the third customer is 11 - 4 = 7.
+So the average waiting time = (2 + 6 + 7) / 3 = 5.
+
+
+Example 2:
+
+
+Input: customers = [[5,2],[5,4],[10,3],[20,1]]
+Output: 3.25000
+Explanation:
+1) The first customer arrives at time 5, the chef takes his order and starts preparing it immediately at time 5, and finishes at time 7, so the waiting time of the first customer is 7 - 5 = 2.
+2) The second customer arrives at time 5, the chef takes his order and starts preparing it at time 7, and finishes at time 11, so the waiting time of the second customer is 11 - 5 = 6.
+3) The third customer arrives at time 10, the chef takes his order and starts preparing it at time 11, and finishes at time 14, so the waiting time of the third customer is 14 - 10 = 4.
+4) The fourth customer arrives at time 20, the chef takes his order and starts preparing it immediately at time 20, and finishes at time 21, so the waiting time of the fourth customer is 21 - 20 = 1.
+So the average waiting time = (2 + 6 + 4 + 1) / 4 = 3.25.
+
+
+
+Constraints:
+
+
+ 1 <= customers.length <= 105
+ 1 <= arrivali, timei <= 104
+ arrivali <= arrivali+1
+
+
+### Related Topics
+ [[Array](../../tag/array/README.md)]
+
+### Hints
+
+Hint 1
+Iterate on the customers, maintaining the time the chef will finish the previous orders.
+
+
+
+Hint 2
+If that time is before the current arrival time, the chef starts immediately. Else, the current customer waits till the chef finishes, and then the chef starts.
+
+
+
+Hint 3
+Update the running time by the time when the chef starts preparing + preparation time.
+
diff --git a/problems/balanced-binary-tree/README.md b/problems/balanced-binary-tree/README.md
index 91cc92e44..cd36c5406 100644
--- a/problems/balanced-binary-tree/README.md
+++ b/problems/balanced-binary-tree/README.md
@@ -52,6 +52,7 @@
### Related Topics
[[Tree](../../tag/tree/README.md)]
[[Depth-first Search](../../tag/depth-first-search/README.md)]
+ [[Recursion](../../tag/recursion/README.md)]
### Similar Questions
1. [Maximum Depth of Binary Tree](../maximum-depth-of-binary-tree) (Easy)
diff --git a/problems/basic-calculator/README.md b/problems/basic-calculator/README.md
index ce4653dd8..aec611066 100644
--- a/problems/basic-calculator/README.md
+++ b/problems/basic-calculator/README.md
@@ -11,33 +11,37 @@
## [224. Basic Calculator (Hard)](https://leetcode.com/problems/basic-calculator "基本计算器")
-Implement a basic calculator to evaluate a simple expression string.
-
-The expression string may contain open (
and closing parentheses )
, the plus +
or minus sign -
, non-negative integers and empty spaces
.
+Given a string s
representing an expression, implement a basic calculator to evaluate it.
+
Example 1:
-Input: "1 + 1"
+Input: s = "1 + 1"
Output: 2
Example 2:
-Input: " 2-1 + 2 "
-Output: 3
+Input: s = " 2-1 + 2 "
+Output: 3
+
Example 3:
-Input: "(1+(4+5+2)-3)+(6+8)"
-Output: 23
-Note:
+Input: s = "(1+(4+5+2)-3)+(6+8)"
+Output: 23
+
+
+
+Constraints:
- - You may assume that the given expression is always valid.
- - Do not use the
eval
built-in library function.
+ 1 <= s.length <= 3 * 105
+ s
consists of digits, '+'
, '-'
, '('
, ')'
, and ' '
.
+ s
represents a valid expression.
### Related Topics
diff --git a/problems/binary-tree-level-order-traversal-ii/README.md b/problems/binary-tree-level-order-traversal-ii/README.md
index d9e2f1472..979c5576a 100644
--- a/problems/binary-tree-level-order-traversal-ii/README.md
+++ b/problems/binary-tree-level-order-traversal-ii/README.md
@@ -9,7 +9,7 @@
[Next >](../convert-sorted-array-to-binary-search-tree "Convert Sorted Array to Binary Search Tree")
-## [107. Binary Tree Level Order Traversal II (Easy)](https://leetcode.com/problems/binary-tree-level-order-traversal-ii "二叉树的层次遍历 II")
+## [107. Binary Tree Level Order Traversal II (Easy)](https://leetcode.com/problems/binary-tree-level-order-traversal-ii "二叉树的层序遍历 II")
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
diff --git a/problems/binary-tree-maximum-path-sum/README.md b/problems/binary-tree-maximum-path-sum/README.md
index b236d9243..508e0d2df 100644
--- a/problems/binary-tree-maximum-path-sum/README.md
+++ b/problems/binary-tree-maximum-path-sum/README.md
@@ -41,6 +41,7 @@
### Related Topics
[[Tree](../../tag/tree/README.md)]
[[Depth-first Search](../../tag/depth-first-search/README.md)]
+ [[Recursion](../../tag/recursion/README.md)]
### Similar Questions
1. [Path Sum](../path-sum) (Easy)
diff --git a/problems/binary-tree-zigzag-level-order-traversal/README.md b/problems/binary-tree-zigzag-level-order-traversal/README.md
index 10e9b8169..16ffa8bda 100644
--- a/problems/binary-tree-zigzag-level-order-traversal/README.md
+++ b/problems/binary-tree-zigzag-level-order-traversal/README.md
@@ -9,7 +9,7 @@
[Next >](../maximum-depth-of-binary-tree "Maximum Depth of Binary Tree")
-## [103. Binary Tree Zigzag Level Order Traversal (Medium)](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal "二叉树的锯齿形层次遍历")
+## [103. Binary Tree Zigzag Level Order Traversal (Medium)](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal "二叉树的锯齿形层序遍历")
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
diff --git a/problems/burst-balloons/README.md b/problems/burst-balloons/README.md
index 8dff26fd9..1ea3f3b9f 100644
--- a/problems/burst-balloons/README.md
+++ b/problems/burst-balloons/README.md
@@ -11,26 +11,38 @@
## [312. Burst Balloons (Hard)](https://leetcode.com/problems/burst-balloons "戳气球")
-Given n
balloons, indexed from 0
to n-1
. Each balloon is painted with a number on it represented by array nums
. You are asked to burst all the balloons. If the you burst balloon i
you will get nums[left] * nums[i] * nums[right]
coins. Here left
and right
are adjacent indices of i
. After the burst, the left
and right
then becomes adjacent.
+You are given n
balloons, indexed from 0
to n - 1
. Each balloon is painted with a number on it represented by an array nums
. You are asked to burst all the balloons.
-Find the maximum coins you can collect by bursting the balloons wisely.
+If you burst the ith
balloon, you will get nums[left] * nums[i] * nums[right]
coins. Here left
and right
are adjacent indices of i
. After the burst, the left
and right
then becomes adjacent.
-Note:
+Return the maximum coins you can collect by bursting the balloons wisely.
-
- - You may imagine
nums[-1] = nums[n] = 1
. They are not real therefore you can not burst them.
- - 0 ≤
n
≤ 500, 0 ≤ nums[i]
≤ 100
-
+
+Example 1:
+
+
+Input: nums = [3,1,5,8]
+Output: 167
+Explanation:
+
nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> []
+coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167
-Example:
+Example 2:
-Input: [3,1,5,8]
-Output: 167
-Explanation:
nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> []
- coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167
+Input: nums = [1,5]
+Output: 10
+
+Constraints:
+
+
+ n == nums.length
+ 1 <= n <= 500
+ 0 <= nums[i] <= 100
+
+
### Related Topics
[[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
[[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/check-if-array-pairs-are-divisible-by-k/README.md b/problems/check-if-array-pairs-are-divisible-by-k/README.md
index d023b74de..273b50fc4 100644
--- a/problems/check-if-array-pairs-are-divisible-by-k/README.md
+++ b/problems/check-if-array-pairs-are-divisible-by-k/README.md
@@ -61,10 +61,10 @@
arr.length == n
- 1 <= n <= 10^5
+ 1 <= n <= 105
n
is even.
- -10^9 <= arr[i] <= 10^9
- 1 <= k <= 10^5
+ -109 <= arr[i] <= 109
+ 1 <= k <= 105
### Related Topics
diff --git a/problems/checking-existence-of-edge-length-limited-paths/README.md b/problems/checking-existence-of-edge-length-limited-paths/README.md
new file mode 100644
index 000000000..1365ed803
--- /dev/null
+++ b/problems/checking-existence-of-edge-length-limited-paths/README.md
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+[< Previous](../jump-game-vi "Jump Game VI")
+
+[Next >](../number-of-distinct-substrings-in-a-string "Number of Distinct Substrings in a String")
+
+## [1697. Checking Existence of Edge Length Limited Paths (Hard)](https://leetcode.com/problems/checking-existence-of-edge-length-limited-paths "检查边长度限制的路径是否存在")
+
+An undirected graph of n
nodes is defined by edgeList
, where edgeList[i] = [ui, vi, disi]
denotes an edge between nodes ui
and vi
with distance disi
. Note that there may be multiple edges between two nodes.
+
+Given an array queries
, where queries[j] = [pj, qj, limitj]
, your task is to determine for each queries[j]
whether there is a path between pj
and qj
such that each edge on the path has a distance strictly less than limitj
.
+
+Return a boolean array answer
, where answer.length == queries.length
and the jth
value of answer
is true
if there is a path for queries[j]
is true
, and false
otherwise.
+
+
+Example 1:
+
+
+Input: n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]
+Output: [false,true]
+Explanation: The above figure shows the given graph. Note that there are two overlapping edges between 0 and 1 with distances 2 and 16.
+For the first query, between 0 and 1 there is no path where each distance is less than 2, thus we return false for this query.
+For the second query, there is a path (0 -> 1 -> 2) of two edges with distances less than 5, thus we return true for this query.
+
+
+Example 2:
+
+
+Input: n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]
+Output: [true,false]
+Exaplanation: The above figure shows the given graph.
+
+
+
+Constraints:
+
+
+ 2 <= n <= 105
+ 1 <= edgeList.length, queries.length <= 105
+ edgeList[i].length == 3
+ queries[j].length == 3
+ 0 <= ui, vi, pj, qj <= n - 1
+ ui != vi
+ pj != qj
+ 1 <= disi, limitj <= 109
+ - There may be multiple edges between two nodes.
+
+
+### Related Topics
+ [[Sort](../../tag/sort/README.md)]
+ [[Union Find](../../tag/union-find/README.md)]
+
+### Hints
+
+Hint 1
+All the queries are given in advance. Is there a way you can reorder the queries to avoid repeated computations?
+
diff --git a/problems/cherry-pickup/README.md b/problems/cherry-pickup/README.md
index d78c181cc..bda881439 100644
--- a/problems/cherry-pickup/README.md
+++ b/problems/cherry-pickup/README.md
@@ -11,59 +11,52 @@
## [741. Cherry Pickup (Hard)](https://leetcode.com/problems/cherry-pickup "摘樱桃")
-In a N x N grid
representing a field of cherries, each cell is one of three possible integers.
-
-
+You are given an n x n
grid
representing a field of cherries, each cell is one of three possible integers.
- - 0 means the cell is empty, so you can pass through;
- - 1 means the cell contains a cherry, that you can pick up and pass through;
- - -1 means the cell contains a thorn that blocks your way.
+ 0
means the cell is empty, so you can pass through,
+ 1
means the cell contains a cherry that you can pick up and pass through, or
+ -1
means the cell contains a thorn that blocks your way.
-
-
-Your task is to collect maximum number of cherries possible by following the rules below:
-
-
+Return the maximum number of cherries you can collect by following the rules below:
- - Starting at the position (0, 0) and reaching (N-1, N-1) by moving right or down through valid path cells (cells with value 0 or 1);
- - After reaching (N-1, N-1), returning to (0, 0) by moving left or up through valid path cells;
- - When passing through a path cell containing a cherry, you pick it up and the cell becomes an empty cell (0);
- - If there is no valid path between (0, 0) and (N-1, N-1), then no cherries can be collected.
+ - Starting at the position
(0, 0)
and reaching (n - 1, n - 1)
by moving right or down through valid path cells (cells with value 0
or 1
).
+ - After reaching
(n - 1, n - 1)
, returning to (0, 0)
by moving left or up through valid path cells.
+ - When passing through a path cell containing a cherry, you pick it up, and the cell becomes an empty cell
0
.
+ - If there is no valid path between
(0, 0)
and (n - 1, n - 1)
, then no cherries can be collected.
-
-
-
-Example 1:
-
+Example 1:
+
-Input: grid =
-[[0, 1, -1],
- [1, 0, -1],
- [1, 1, 1]]
-Output: 5
-Explanation:
-The player started at (0, 0) and went down, down, right right to reach (2, 2).
+Input: grid = [[0,1,-1],[1,0,-1],[1,1,1]]
+Output: 5
+Explanation: The player started at (0, 0) and went down, down, right right to reach (2, 2).
4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]].
Then, the player went left, up, up, left to return home, picking up one more cherry.
The total number of cherries picked up is 5, and this is the maximum possible.
-
+Example 2:
-Note:
+
+Input: grid = [[1,1,-1],[1,-1,1],[-1,1,1]]
+Output: 0
+
+
+
+Constraints:
- grid
is an N
by N
2D array, with 1 <= N <= 50
.
- - Each
grid[i][j]
is an integer in the set {-1, 0, 1}
.
- - It is guaranteed that grid[0][0] and grid[N-1][N-1] are not -1.
- -
-
-
+ n == grid.length
+ n == grid[i].length
+ 1 <= n <= 50
+ grid[i][j]
is -1
, 0
, or 1
.
+ grid[0][0] != -1
+ grid[n - 1][n - 1] != -1
### Related Topics
diff --git a/problems/concatenated-words/README.md b/problems/concatenated-words/README.md
index bb66dc160..df394b693 100644
--- a/problems/concatenated-words/README.md
+++ b/problems/concatenated-words/README.md
@@ -11,27 +11,36 @@
## [472. Concatenated Words (Hard)](https://leetcode.com/problems/concatenated-words "连接词")
-Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words.
+Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words.
+
A concatenated word is defined as a string that is comprised entirely of at least two shorter words in the given array.
-Example:
+
+Example 1:
+
-Input: ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"]
+Input: words = ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"]
+Output: ["catsdogcats","dogcatsdog","ratcatdogcat"]
+Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats";
+"dogcatsdog" can be concatenated by "dog", "cats" and "dog";
+"ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat".
-Output: ["catsdogcats","dogcatsdog","ratcatdogcat"]
+Example 2:
-Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats";
"dogcatsdog" can be concatenated by "dog", "cats" and "dog";
"ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat".
+
+Input: words = ["cat","dog","catdog"]
+Output: ["catdog"]
-
-
-Note:
-
-- The number of elements of the given array will not exceed
10,000
- - The length sum of elements in the given array will not exceed
600,000
.
-- All the input string will only include lower case letters.
-- The returned elements order does not matter.
-
-
+
+
+Constraints:
+
+
+ 1 <= words.length <= 104
+ 0 <= words[i].length <= 1000
+ words[i]
consists of only lowercase English letters.
+ 0 <= sum(words[i].length) <= 6 * 105
+
### Related Topics
[[Depth-first Search](../../tag/depth-first-search/README.md)]
diff --git a/problems/consecutive-numbers/README.md b/problems/consecutive-numbers/README.md
index 6a5efe60c..2944d265c 100644
--- a/problems/consecutive-numbers/README.md
+++ b/problems/consecutive-numbers/README.md
@@ -11,28 +11,47 @@
## [180. Consecutive Numbers (Medium)](https://leetcode.com/problems/consecutive-numbers "连续出现的数字")
-Write a SQL query to find all numbers that appear at least three times consecutively.
+Table: Logs
++-------------+---------+
+| Column Name | Type |
++-------------+---------+
+| id | int |
+| num | varchar |
++-------------+---------+
+id is the primary key for this table.
+
+
+
+
+Write an SQL query to find all numbers that appear at least three times consecutively.
+
+Return the result table in any order.
+
+The query result format is in the following example:
+
+
+
+
+Logs table:
+----+-----+
| Id | Num |
+----+-----+
-| 1 | 1 |
-| 2 | 1 |
-| 3 | 1 |
-| 4 | 2 |
-| 5 | 1 |
-| 6 | 2 |
-| 7 | 2 |
+| 1 | 1 |
+| 2 | 1 |
+| 3 | 1 |
+| 4 | 2 |
+| 5 | 1 |
+| 6 | 2 |
+| 7 | 2 |
+----+-----+
-
-For example, given the above Logs
table, 1
is the only number that appears consecutively for at least three times.
-
-
+Result table:
+-----------------+
| ConsecutiveNums |
+-----------------+
| 1 |
+-----------------+
+1 is the only number that appears consecutively for at least three times.
diff --git a/problems/count-ways-to-distribute-candies/README.md b/problems/count-ways-to-distribute-candies/README.md
new file mode 100644
index 000000000..e63e5eb22
--- /dev/null
+++ b/problems/count-ways-to-distribute-candies/README.md
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+[< Previous](../maximum-height-by-stacking-cuboids "Maximum Height by Stacking Cuboids ")
+
+[Next >](../daily-leads-and-partners "Daily Leads and Partners")
+
+## [1692. Count Ways to Distribute Candies (Hard)](https://leetcode.com/problems/count-ways-to-distribute-candies "")
+
+
+
+### Related Topics
+ [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
+
+### Hints
+
+Hint 1
+Try to define a recursive approach. For the ith candies, there will be one of the two following cases:
+
+
+
+Hint 2
+If the i - 1 previous candies are already distributed into k bags for the ith candy, you can have k * dp[n - 1][k] ways to distribute the ith candy. We need then to solve the state of (n - 1, k).
+
+
+
+Hint 3
+If the i - 1 previous candies are already distributed into k - 1 bags for the ith candy, you can have dp[n - 1][k - 1] ways to distribute the ith candy. We need then to solve the state of (n - 1, k - 1).
+
+
+
+Hint 4
+This approach will be too slow and will traverse some states more than once. We should use memoization to make the algorithm efficient.
+
diff --git a/problems/daily-leads-and-partners/README.md b/problems/daily-leads-and-partners/README.md
new file mode 100644
index 000000000..aaf480f21
--- /dev/null
+++ b/problems/daily-leads-and-partners/README.md
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+[< Previous](../count-ways-to-distribute-candies "Count Ways to Distribute Candies")
+
+[Next >](../reformat-phone-number "Reformat Phone Number")
+
+## [1693. Daily Leads and Partners (Easy)](https://leetcode.com/problems/daily-leads-and-partners "")
+
+
diff --git a/problems/daily-leads-and-partners/mysql_schemas.sql b/problems/daily-leads-and-partners/mysql_schemas.sql
new file mode 100644
index 000000000..53e2eb911
--- /dev/null
+++ b/problems/daily-leads-and-partners/mysql_schemas.sql
@@ -0,0 +1,12 @@
+Create table If Not Exists DailySales(date_id date, make_name varchar(20), lead_id int, partner_id int);
+Truncate table DailySales;
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '0', '1');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '1', '0');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '1', '2');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'toyota', '0', '2');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'toyota', '0', '1');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'honda', '1', '2');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'honda', '2', '1');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '0', '1');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '1', '2');
+insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '2', '1');
diff --git a/problems/design-underground-system/README.md b/problems/design-underground-system/README.md
index 18ab2eb5a..ddd1c885f 100644
--- a/problems/design-underground-system/README.md
+++ b/problems/design-underground-system/README.md
@@ -11,30 +11,30 @@
## [1396. Design Underground System (Medium)](https://leetcode.com/problems/design-underground-system "设计地铁系统")
-Implement the class UndergroundSystem
that supports three methods:
-
-1. checkIn(int id, string stationName, int t)
-
-
- - A customer with id card equal to
id
, gets in the station stationName
at time t
.
- - A customer can only be checked into one place at a time.
-
-
-2. checkOut(int id, string stationName, int t)
-
-
- - A customer with id card equal to
id
, gets out from the station stationName
at time t
.
-
-
-3. getAverageTime(string startStation, string endStation)
+Implement the UndergroundSystem
class:
- - Returns the average time to travel between the
startStation
and the endStation
.
- - The average time is computed from all the previous traveling from
startStation
to endStation
that happened directly.
- - Call to
getAverageTime
is always valid.
+ void checkIn(int id, string stationName, int t)
+
+ - A customer with a card id equal to
id
, gets in the station stationName
at time t
.
+ - A customer can only be checked into one place at a time.
+
+
+ void checkOut(int id, string stationName, int t)
+
+ - A customer with a card id equal to
id
, gets out from the station stationName
at time t
.
+
+
+ double getAverageTime(string startStation, string endStation)
+
+ - Returns the average time to travel between the
startStation
and the endStation
.
+ - The average time is computed from all the previous traveling from
startStation
to endStation
that happened directly.
+ - Call to
getAverageTime
is always valid.
+
+
-You can assume all calls to checkIn
and checkOut
methods are consistent. That is, if a customer gets in at time t1 at some station, then it gets out at time t2 with t2 > t1. All events happen in chronological order.
+You can assume all calls to checkIn
and checkOut
methods are consistent. If a customer gets in at time t1 at some station, they get out at time t2 with t2 > t1. All events happen in chronological order.
Example 1:
@@ -90,11 +90,11 @@ undergroundSystem.getAverageTime("Leyton", "Paradise"); // r
Constraints:
- - There will be at most
20000
operations.
- 1 <= id, t <= 10^6
- - All strings consist of uppercase, lowercase English letters and digits.
- 1 <= stationName.length <= 10
- - Answers within
10^-5
of the actual value will be accepted as correct.
+ - There will be at most
20000
operations.
+ 1 <= id, t <= 106
+ - All strings consist of uppercase and lowercase English letters, and digits.
+ 1 <= stationName.length <= 10
+ - Answers within
10-5
of the actual value will be accepted as correct.
### Related Topics
diff --git a/problems/determine-if-string-halves-are-alike/README.md b/problems/determine-if-string-halves-are-alike/README.md
new file mode 100644
index 000000000..52fddc049
--- /dev/null
+++ b/problems/determine-if-string-halves-are-alike/README.md
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+[< Previous](../minimum-adjacent-swaps-for-k-consecutive-ones "Minimum Adjacent Swaps for K Consecutive Ones")
+
+[Next >](../maximum-number-of-eaten-apples "Maximum Number of Eaten Apples")
+
+## [1704. Determine if String Halves Are Alike (Easy)](https://leetcode.com/problems/determine-if-string-halves-are-alike "判断字符串的两半是否相似")
+
+You are given a string s
of even length. Split this string into two halves of equal lengths, and let a
be the first half and b
be the second half.
+
+Two strings are alike if they have the same number of vowels ('a'
, 'e'
, 'i'
, 'o'
, 'u'
, 'A'
, 'E'
, 'I'
, 'O'
, 'U'
). Notice that s
contains uppercase and lowercase letters.
+
+Return true
if a
and b
are alike. Otherwise, return false
.
+
+
+Example 1:
+
+
+Input: s = "book"
+Output: true
+Explanation: a = "bo" and b = "ok". a has 1 vowel and b has 1 vowel. Therefore, they are alike.
+
+
+Example 2:
+
+
+Input: s = "textbook"
+Output: false
+Explanation: a = "text" and b = "book". a has 1 vowel whereas b has 2. Therefore, they are not alike.
+Notice that the vowel o is counted twice.
+
+
+Example 3:
+
+
+Input: s = "MerryChristmas"
+Output: false
+
+
+Example 4:
+
+
+Input: s = "AbCdEfGh"
+Output: true
+
+
+
+Constraints:
+
+
+ 2 <= s.length <= 1000
+ s.length
is even.
+ s
consists of uppercase and lowercase letters.
+
+
+### Related Topics
+ [[String](../../tag/string/README.md)]
+
+### Hints
+
+Hint 1
+Create a function that checks if a character is a vowel, either uppercase or lowercase.
+
diff --git a/problems/distribute-coins-in-binary-tree/README.md b/problems/distribute-coins-in-binary-tree/README.md
index 5a8d2fecc..f58dc8a7c 100644
--- a/problems/distribute-coins-in-binary-tree/README.md
+++ b/problems/distribute-coins-in-binary-tree/README.md
@@ -11,68 +11,52 @@
## [979. Distribute Coins in Binary Tree (Medium)](https://leetcode.com/problems/distribute-coins-in-binary-tree "在二叉树中分配硬币")
-Given the root
of a binary tree with N
nodes, each node
in the tree has node.val
coins, and there are N
coins total.
+You are given the root
of a binary tree with n
nodes where each node
in the tree has node.val
coins and there are n
coins total.
-In one move, we may choose two adjacent nodes and move one coin from one node to another. (The move may be from parent to child, or from child to parent.)
+In one move, we may choose two adjacent nodes and move one coin from one node to another. (A move may be from parent to child, or from child to parent.)
Return the number of moves required to make every node have exactly one coin.
-
-
Example 1:
-
-

-
+
-Input: [3,0,0]
-Output: 2
+Input: root = [3,0,0]
+Output: 2
Explanation: From the root of the tree, we move one coin to its left child, and one coin to its right child.
-
Example 2:
-
-

-
+
-Input: [0,3,0]
-Output: 3
+Input: root = [0,3,0]
+Output: 3
Explanation: From the left child of the root, we move two coins to the root [taking two moves]. Then, we move one coin from the root of the tree to the right child.
-
Example 3:
-
-

-
+
-Input: [1,0,2]
-Output: 2
+Input: root = [1,0,2]
+Output: 2
-
Example 4:
-
-

-
+
-Input: [1,0,0,null,3]
-Output: 4
+Input: root = [1,0,0,null,3]
+Output: 4
-
-
Note:
-
-
- 1<= N <= 100
- 0 <= node.val <= N
-
-
-
-
-
+Constraints:
+
+
+ - The number of nodes in the tree is
n
.
+ 1 <= n <= 100
+ 0 <= Node.val <= n
+ - The sum of
Node.val
is n
.
+
### Related Topics
[[Tree](../../tag/tree/README.md)]
diff --git a/problems/exchange-seats/README.md b/problems/exchange-seats/README.md
index b68568d1a..f05ac0931 100644
--- a/problems/exchange-seats/README.md
+++ b/problems/exchange-seats/README.md
@@ -12,13 +12,12 @@
## [626. Exchange Seats (Medium)](https://leetcode.com/problems/exchange-seats "换座位")
Mary is a teacher in a middle school and she has a table seat
storing students' names and their corresponding seat ids.
-The column id is continuous increment.
-
-Mary wants to change seats for the adjacent students.
+The column id is continuous increment.
-
-Can you write a SQL query to output the result for Mary?
+Mary wants to change seats for the adjacent students.
+
+Can you write a SQL query to output the result for Mary?
@@ -33,9 +32,8 @@ Can you write a SQL query to output the result for Mary?
| 5 | Jeames |
+---------+---------+
-For the sample input, the output is:
-
+For the sample input, the output is:
+---------+---------+
@@ -49,5 +47,6 @@ For the sample input, the output is:
+---------+---------+
-Note:
-If the number of students is odd, there is no need to change the last one's seat.
+Note:
+
+If the number of students is odd, there is no need to change the last one's seat.
diff --git a/problems/factorial-trailing-zeroes/README.md b/problems/factorial-trailing-zeroes/README.md
index 10e4a76f7..d5a86fafa 100644
--- a/problems/factorial-trailing-zeroes/README.md
+++ b/problems/factorial-trailing-zeroes/README.md
@@ -43,7 +43,7 @@
Constraints:
- 1 <= n <= 104
+ 0 <= n <= 104
### Related Topics
diff --git a/problems/fibonacci-number/README.md b/problems/fibonacci-number/README.md
index c4047fe08..667678df2 100644
--- a/problems/fibonacci-number/README.md
+++ b/problems/fibonacci-number/README.md
@@ -11,21 +11,20 @@
## [509. Fibonacci Number (Easy)](https://leetcode.com/problems/fibonacci-number "斐波那契数")
-The Fibonacci numbers, commonly denoted F(n)
form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0
and 1
. That is,
+The Fibonacci numbers, commonly denoted F(n)
form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0
and 1
. That is,
-F(0) = 0, F(1) = 1
-F(N) = F(N - 1) + F(N - 2), for N > 1.
+F(0) = 0, F(1) = 1
+F(n) = F(n - 1) + F(n - 2), for n > 1.
-Given N
, calculate F(N)
.
+Given n
, calculate F(n)
.
-
Example 1:
-Input: 2
+Input: n = 2
Output: 1
Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1.
@@ -33,7 +32,7 @@ F(N) = F(N - 1) + F(N - 2), for N > 1.
Example 2:
-Input: 3
+Input: n = 3
Output: 2
Explanation: F(3) = F(2) + F(1) = 1 + 1 = 2.
@@ -41,16 +40,17 @@ F(N) = F(N - 1) + F(N - 2), for N > 1.
Example 3:
-Input: 4
+Input: n = 4
Output: 3
Explanation: F(4) = F(3) + F(2) = 2 + 1 = 3.
+Constraints:
-Note:
-
-0 ≤ N
≤ 30.
+
### Related Topics
[[Array](../../tag/array/README.md)]
diff --git a/problems/find-bottom-left-tree-value/README.md b/problems/find-bottom-left-tree-value/README.md
index fbca72dfd..eda7a540a 100644
--- a/problems/find-bottom-left-tree-value/README.md
+++ b/problems/find-bottom-left-tree-value/README.md
@@ -11,43 +11,30 @@
## [513. Find Bottom Left Tree Value (Medium)](https://leetcode.com/problems/find-bottom-left-tree-value "找树左下角的值")
-
-Given a binary tree, find the leftmost value in the last row of the tree.
-
+Given the root
of a binary tree, return the leftmost value in the last row of the tree.
-Example 1:
+
+Example 1:
+
-Input:
-
- 2
- / \
- 1 3
-
-Output:
-1
+Input: root = [2,1,3]
+Output: 1
-
- Example 2:
+
Example 2:
+
-Input:
-
- 1
- / \
- 2 3
- / / \
- 4 5 6
- /
- 7
-
-Output:
-7
+Input: root = [1,2,3,4,null,5,6,null,null,7]
+Output: 7
-
-Note:
-You may assume the tree (i.e., the given root node) is not NULL.
-
+
+Constraints:
+
+
+ - The number of nodes in the tree is in the range
[1, 104]
.
+ -231 <= Node.val <= 231 - 1
+
### Related Topics
[[Tree](../../tag/tree/README.md)]
diff --git a/problems/find-the-smallest-divisor-given-a-threshold/README.md b/problems/find-the-smallest-divisor-given-a-threshold/README.md
index 2dec8542a..daee6eb4b 100644
--- a/problems/find-the-smallest-divisor-given-a-threshold/README.md
+++ b/problems/find-the-smallest-divisor-given-a-threshold/README.md
@@ -45,9 +45,9 @@ If the divisor is 4 we can get a sum to 7 (1+1+2+3) and if the divisor is 5 the
Constraints:
- 1 <= nums.length <= 5 * 10^4
- 1 <= nums[i] <= 10^6
- nums.length <= threshold <= 10^6
+ 1 <= nums.length <= 5 * 104
+ 1 <= nums[i] <= 106
+ nums.length <= threshold <= 106
### Related Topics
diff --git a/problems/friend-requests-i-overall-acceptance-rate/README.md b/problems/friend-requests-i-overall-acceptance-rate/README.md
index 455c32bf6..ea607c203 100644
--- a/problems/friend-requests-i-overall-acceptance-rate/README.md
+++ b/problems/friend-requests-i-overall-acceptance-rate/README.md
@@ -9,7 +9,7 @@
[Next >](../range-addition-ii "Range Addition II")
-## [597. Friend Requests I: Overall Acceptance Rate (Easy)](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate "好友申请 I :总体通过率")
+## [597. Friend Requests I: Overall Acceptance Rate (Easy)](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate "好友申请 I:总体通过率")
In social network like Facebook or Twitter, people send friend requests and accept others’ requests as well. Now given two tables as below:
diff --git a/problems/game-of-life/README.md b/problems/game-of-life/README.md
index 59dfaf890..5022a55d0 100644
--- a/problems/game-of-life/README.md
+++ b/problems/game-of-life/README.md
@@ -18,37 +18,44 @@
- Any live cell with fewer than two live neighbors dies, as if caused by under-population.
- Any live cell with two or three live neighbors lives on to the next generation.
- - Any live cell with more than three live neighbors dies, as if by over-population..
+ - Any live cell with more than three live neighbors dies, as if by over-population.
- Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
Write a function to compute the next state (after one update) of the board given its current state. The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously.
-Example:
+
+Example 1:
+
+
+Input: board = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]]
+Output: [[0,0,0],[1,0,1],[0,1,1],[0,1,0]]
+
+Example 2:
+
-Input:
-[
- [0,1,0],
- [0,0,1],
- [1,1,1],
- [0,0,0]
-]
-Output:
-[
- [0,0,0],
- [1,0,1],
- [0,1,1],
- [0,1,0]
-]
+Input: board = [[1,1],[1,0]]
+Output: [[1,1],[1,1]]
-Follow up:
+
+Constraints:
-
- - Could you solve it in-place? Remember that the board needs to be updated at the same time: You cannot update some cells first and then use their updated values to update other cells.
+
+ m == board.length
+ n == board[i].length
+ 1 <= m, n <= 25
+ board[i][j]
is 0
or 1
.
+
+
+
+Follow up:
+
+
+ - Could you solve it in-place? Remember that the board needs to be updated simultaneously: You cannot update some cells first and then use their updated values to update other cells.
- In this question, we represent the board using a 2D array. In principle, the board is infinite, which would cause problems when the active area encroaches the border of the array. How would you address these problems?
-
+
### Related Topics
[[Array](../../tag/array/README.md)]
diff --git a/problems/grid-illumination/README.md b/problems/grid-illumination/README.md
index db83aaade..bbf36b197 100644
--- a/problems/grid-illumination/README.md
+++ b/problems/grid-illumination/README.md
@@ -28,7 +28,7 @@
Explanation: We have the initial grid with all lamps turned off. In the above picture we see the grid after turning on the lamp at grid[0][0] then turning on the lamp at grid[4][4].
The 0th query asks if the lamp at grid[1][1] is illuminated or not (the blue square). It is illuminated, so set ans[0] = 1. Then, we turn off all lamps in the red square.
-The 1st query asks if the lamp at grid[1][0] is illuminated or not (the blue square). It is not illuminated, so set ans[1] = 1. Then, we turn off all lamps in the red rectangle.
+The 1st query asks if the lamp at grid[1][0] is illuminated or not (the blue square). It is not illuminated, so set ans[1] = 0. Then, we turn off all lamps in the red rectangle.
diff --git a/problems/happy-number/README.md b/problems/happy-number/README.md
index 5c6fe7fc3..8240a0ad8 100644
--- a/problems/happy-number/README.md
+++ b/problems/happy-number/README.md
@@ -11,24 +11,45 @@
## [202. Happy Number (Easy)](https://leetcode.com/problems/happy-number "快乐数")
-Write an algorithm to determine if a number n
is "happy".
+Write an algorithm to determine if a number n
is happy.
-A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers.
+A happy number is a number defined by the following process:
-Return True if n
is a happy number, and False if not.
+
+ - Starting with any positive integer, replace the number by the sum of the squares of its digits.
+ - Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
+ - Those numbers for which this process ends in 1 are happy.
+
-Example:
+Return true
if n
is a happy number, and false
if not.
+
+
+Example 1:
-Input: 19
+Input: n = 19
Output: true
-Explanation:
-12 + 92 = 82
+Explanation:
+12 + 92 = 82
82 + 22 = 68
62 + 82 = 100
12 + 02 + 02 = 1
+Example 2:
+
+
+Input: n = 2
+Output: false
+
+
+
+Constraints:
+
+
+
### Related Topics
[[Hash Table](../../tag/hash-table/README.md)]
[[Math](../../tag/math/README.md)]
diff --git a/problems/implement-stack-using-queues/README.md b/problems/implement-stack-using-queues/README.md
index ae6a8f5f7..958a77d5d 100644
--- a/problems/implement-stack-using-queues/README.md
+++ b/problems/implement-stack-using-queues/README.md
@@ -58,7 +58,7 @@ myStack.empty(); // return False
-Follow-up: Can you implement the stack such that each operation is amortized O(1)
time complexity? In other words, performing n
operations will take overall O(n)
time even if one of those operations may take longer.
+Follow-up: Can you implement the stack such that each operation is amortized O(1)
time complexity? In other words, performing n
operations will take overall O(n)
time even if one of those operations may take longer. You can use more than two queues.
### Related Topics
[[Stack](../../tag/stack/README.md)]
diff --git a/problems/increasing-triplet-subsequence/README.md b/problems/increasing-triplet-subsequence/README.md
index 257fbdbac..fb3e9d238 100644
--- a/problems/increasing-triplet-subsequence/README.md
+++ b/problems/increasing-triplet-subsequence/README.md
@@ -11,32 +11,43 @@
## [334. Increasing Triplet Subsequence (Medium)](https://leetcode.com/problems/increasing-triplet-subsequence "递增的三元子序列")
-Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.
+Given an integer array nums
, return true
if there exists a triple of indices (i, j, k)
such that i < j < k
and nums[i] < nums[j] < nums[k]
. If no such indices exists, return false
.
-Formally the function should:
-
-Return true if there exists i, j, k
-such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-1 else return false.
-
-Note: Your algorithm should run in O(n) time complexity and O(1) space complexity.
-
-
+
Example 1:
-Input: [1,2,3,4,5]
-Output: true
+Input: nums = [1,2,3,4,5]
+Output: true
+Explanation: Any triplet where i < j < k is valid.
-
Example 2:
-Input: [5,4,3,2,1]
-Output: false
+Input: nums = [5,4,3,2,1]
+Output: false
+Explanation: No triplet exists.
+
+
+
Example 3:
+
+
+Input: nums = [2,1,5,0,4,6]
+Output: true
+Explanation: The triplet (3, 4, 5) is valid because nums[3] == 0 < nums[4] == 4 < nums[5] == 6.
-
-
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 105
+ -231 <= nums[i] <= 231 - 1
+
+
+
+Follow up: Could you implement a solution that runs in O(n)
time complexity and O(1)
space complexity?
### Similar Questions
1. [Longest Increasing Subsequence](../longest-increasing-subsequence) (Medium)
diff --git a/problems/jewels-and-stones/README.md b/problems/jewels-and-stones/README.md
index 62e973d48..04d02219c 100644
--- a/problems/jewels-and-stones/README.md
+++ b/problems/jewels-and-stones/README.md
@@ -11,29 +11,25 @@
## [771. Jewels and Stones (Easy)](https://leetcode.com/problems/jewels-and-stones "宝石与石头")
-You're given strings J
representing the types of stones that are jewels, and S
representing the stones you have. Each character in S
is a type of stone you have. You want to know how many of the stones you have are also jewels.
+You're given strings jewels
representing the types of stones that are jewels, and stones
representing the stones you have. Each character in stones
is a type of stone you have. You want to know how many of the stones you have are also jewels.
-The letters in J
are guaranteed distinct, and all characters in J
and S
are letters. Letters are case sensitive, so "a"
is considered a different type of stone from "A"
.
+Letters are case sensitive, so "a"
is considered a different type of stone from "A"
.
+
Example 1:
-
-
-Input: J = "aA", S = "aAAbbbb"
+Input: jewels = "aA", stones = "aAAbbbb"
Output: 3
-
-
-Example 2:
-
-
-Input: J = "z", S = "ZZ"
+
Example 2:
+Input: jewels = "z", stones = "ZZ"
Output: 0
-
-Note:
+
+Constraints:
- S
and J
will consist of letters and have length at most 50.
- - The characters in
J
are distinct.
+ 1 <= jewels.length, stones.length <= 50
+ jewels
and stones
consist of only English letters.
+ - All the characters of
jewels
are unique.
### Related Topics
diff --git a/problems/jump-game-iii/README.md b/problems/jump-game-iii/README.md
index 9b9c278ff..4b5109f5d 100644
--- a/problems/jump-game-iii/README.md
+++ b/problems/jump-game-iii/README.md
@@ -49,7 +49,7 @@ index 0 -> index 4 -> index 1 -> index 3
Constraints:
- 1 <= arr.length <= 5 * 10^4
+ 1 <= arr.length <= 5 * 104
0 <= arr[i] < arr.length
0 <= start < arr.length
diff --git a/problems/jump-game-vi/README.md b/problems/jump-game-vi/README.md
new file mode 100644
index 000000000..2e41a72ec
--- /dev/null
+++ b/problems/jump-game-vi/README.md
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+[< Previous](../maximum-erasure-value "Maximum Erasure Value")
+
+[Next >](../checking-existence-of-edge-length-limited-paths "Checking Existence of Edge Length Limited Paths")
+
+## [1696. Jump Game VI (Medium)](https://leetcode.com/problems/jump-game-vi "跳跃游戏 VI")
+
+You are given a 0-indexed integer array nums
and an integer k
.
+
+You are initially standing at index 0
. In one move, you can jump at most k
steps forward without going outside the boundaries of the array. That is, you can jump from index i
to any index in the range [i + 1, min(n - 1, i + k)]
inclusive.
+
+You want to reach the last index of the array (index n - 1
). Your score is the sum of all nums[j]
for each index j
you visited in the array.
+
+Return the maximum score you can get.
+
+
+Example 1:
+
+
+Input: nums = [1,-1,-2,4,-7,3], k = 2
+Output: 7
+Explanation: You can choose your jumps forming the subsequence [1,-1,4,3] (underlined above). The sum is 7.
+
+
+Example 2:
+
+
+Input: nums = [10,-5,-2,4,0,3], k = 3
+Output: 17
+Explanation: You can choose your jumps forming the subsequence [10,4,3] (underlined above). The sum is 17.
+
+
+Example 3:
+
+
+Input: nums = [1,-5,-20,4,-1,3,-6,-3], k = 2
+Output: 0
+
+
+
+Constraints:
+
+
+ -
1 <= nums.length, k <= 105
+ -104 <= nums[i] <= 104
+
+
+### Hints
+
+Hint 1
+Let dp[i] be "the maximum score to reach the end starting at index i". The answer for dp[i] is nums[i] + min{dp[i+j]} for 1 <= j <= k. That gives an O(n*k) solution.
+
+
+
+Hint 2
+Instead of checking every j for every i, keep track of the smallest dp[i] values in a heap and calculate dp[i] from right to left. When the smallest value in the heap is out of bounds of the current index, remove it and keep checking.
+
diff --git a/problems/jump-game/README.md b/problems/jump-game/README.md
index 566f54531..b0d1ac8b7 100644
--- a/problems/jump-game/README.md
+++ b/problems/jump-game/README.md
@@ -11,7 +11,7 @@
## [55. Jump Game (Medium)](https://leetcode.com/problems/jump-game "跳跃游戏")
-Given an array of non-negative integers, you are initially positioned at the first index of the array.
+Given an array of non-negative integers nums
, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
@@ -38,8 +38,8 @@
Constraints:
- 1 <= nums.length <= 3 * 10^4
- 0 <= nums[i][j] <= 10^5
+ 1 <= nums.length <= 3 * 104
+ 0 <= nums[i] <= 105
### Related Topics
diff --git a/problems/length-of-longest-fibonacci-subsequence/README.md b/problems/length-of-longest-fibonacci-subsequence/README.md
index 9ee36d6ae..2d0bb2b6b 100644
--- a/problems/length-of-longest-fibonacci-subsequence/README.md
+++ b/problems/length-of-longest-fibonacci-subsequence/README.md
@@ -11,49 +11,38 @@
## [873. Length of Longest Fibonacci Subsequence (Medium)](https://leetcode.com/problems/length-of-longest-fibonacci-subsequence "最长的斐波那契子序列的长度")
-A sequence X_1, X_2, ..., X_n
is fibonacci-like if:
+A sequence X1, X2, ..., Xn
is Fibonacci-like if:
n >= 3
- X_i + X_{i+1} = X_{i+2}
for all i + 2 <= n
+ Xi + Xi+1 = Xi+2
for all i + 2 <= n
-Given a strictly increasing array A
of positive integers forming a sequence, find the length of the longest fibonacci-like subsequence of A
. If one does not exist, return 0.
+Given a strictly increasing array arr
of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence of arr
. If one does not exist, return 0
.
-(Recall that a subsequence is derived from another sequence A
by deleting any number of elements (including none) from A
, without changing the order of the remaining elements. For example, [3, 5, 8]
is a subsequence of [3, 4, 5, 6, 7, 8]
.)
+A subsequence is derived from another sequence arr
by deleting any number of elements (including none) from arr
, without changing the order of the remaining elements. For example, [3, 5, 8]
is a subsequence of [3, 4, 5, 6, 7, 8]
.
-
-
-
Example 1:
-Input: [1,2,3,4,5,6,7,8]
-Output: 5
-Explanation:
-The longest subsequence that is fibonacci-like: [1,2,3,5,8].
-
+Input: arr = [1,2,3,4,5,6,7,8]
+Output: 5
+Explanation: The longest subsequence that is fibonacci-like: [1,2,3,5,8].
Example 2:
-Input: [1,3,7,11,12,14,18]
-Output: 3
-Explanation:
-The longest subsequence that is fibonacci-like:
-[1,11,12], [3,11,14] or [7,11,18].
-
+Input: arr = [1,3,7,11,12,14,18]
+Output: 3
+Explanation: The longest subsequence that is fibonacci-like: [1,11,12], [3,11,14] or [7,11,18].
-
-Note:
+Constraints:
- 3 <= A.length <= 1000
- 1 <= A[0] < A[1] < ... < A[A.length - 1] <= 10^9
- - (The time limit has been reduced by 50% for submissions in Java, C, and C++.)
+ 3 <= arr.length <= 1000
+ 1 <= arr[i] < arr[i + 1] <= 109
### Related Topics
diff --git a/problems/longest-increasing-subsequence/README.md b/problems/longest-increasing-subsequence/README.md
index f19c9c7d6..47fd7b3f7 100644
--- a/problems/longest-increasing-subsequence/README.md
+++ b/problems/longest-increasing-subsequence/README.md
@@ -9,7 +9,7 @@
[Next >](../remove-invalid-parentheses "Remove Invalid Parentheses")
-## [300. Longest Increasing Subsequence (Medium)](https://leetcode.com/problems/longest-increasing-subsequence "最长上升子序列")
+## [300. Longest Increasing Subsequence (Medium)](https://leetcode.com/problems/longest-increasing-subsequence "最长递增子序列")
Given an integer array nums
, return the length of the longest strictly increasing subsequence.
diff --git a/problems/longest-palindrome/README.md b/problems/longest-palindrome/README.md
index 15fd9a6e9..7839ec9e3 100644
--- a/problems/longest-palindrome/README.md
+++ b/problems/longest-palindrome/README.md
@@ -44,7 +44,7 @@ One longest palindrome that can be built is "dccaccd", whose length is
1 <= s.length <= 2000
- s
consits of lower-case and/or upper-case English letters only.
+ s
consists of lowercase and/or uppercase English letters only.
### Related Topics
diff --git a/problems/longest-repeating-character-replacement/README.md b/problems/longest-repeating-character-replacement/README.md
index 4effd154d..24bd5af8d 100644
--- a/problems/longest-repeating-character-replacement/README.md
+++ b/problems/longest-repeating-character-replacement/README.md
@@ -56,5 +56,5 @@ The substring "BBBB" has the longest repeating letters, which is 4.
[[Sliding Window](../../tag/sliding-window/README.md)]
### Similar Questions
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Hard)
+ 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
1. [Max Consecutive Ones III](../max-consecutive-ones-iii) (Medium)
diff --git a/problems/longest-substring-with-at-most-k-distinct-characters/README.md b/problems/longest-substring-with-at-most-k-distinct-characters/README.md
index 2ef66431a..8c2122c1d 100644
--- a/problems/longest-substring-with-at-most-k-distinct-characters/README.md
+++ b/problems/longest-substring-with-at-most-k-distinct-characters/README.md
@@ -9,7 +9,7 @@
[Next >](../flatten-nested-list-iterator "Flatten Nested List Iterator")
-## [340. Longest Substring with At Most K Distinct Characters (Hard)](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters "至多包含 K 个不同字符的最长子串")
+## [340. Longest Substring with At Most K Distinct Characters (Medium)](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters "至多包含 K 个不同字符的最长子串")
Given a string, find the length of the longest substring T that contains at most k distinct characters.
@@ -32,6 +32,7 @@
### Related Topics
[[Hash Table](../../tag/hash-table/README.md)]
+ [[Two Pointers](../../tag/two-pointers/README.md)]
[[String](../../tag/string/README.md)]
[[Sliding Window](../../tag/sliding-window/README.md)]
diff --git a/problems/longest-substring-with-at-most-two-distinct-characters/README.md b/problems/longest-substring-with-at-most-two-distinct-characters/README.md
index a8177ceef..f7fc0adc4 100644
--- a/problems/longest-substring-with-at-most-two-distinct-characters/README.md
+++ b/problems/longest-substring-with-at-most-two-distinct-characters/README.md
@@ -36,5 +36,5 @@
### Similar Questions
1. [Longest Substring Without Repeating Characters](../longest-substring-without-repeating-characters) (Medium)
1. [Sliding Window Maximum](../sliding-window-maximum) (Hard)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Hard)
+ 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
1. [Subarrays with K Different Integers](../subarrays-with-k-different-integers) (Hard)
diff --git a/problems/longest-substring-without-repeating-characters/README.md b/problems/longest-substring-without-repeating-characters/README.md
index 7cf835f90..1eeb9dc6c 100644
--- a/problems/longest-substring-without-repeating-characters/README.md
+++ b/problems/longest-substring-without-repeating-characters/README.md
@@ -62,5 +62,5 @@ Notice that the answer must be a substring, "pwke" is a subsequence an
### Similar Questions
1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Hard)
+ 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
1. [Subarrays with K Different Integers](../subarrays-with-k-different-integers) (Hard)
diff --git a/problems/max-consecutive-ones-iii/README.md b/problems/max-consecutive-ones-iii/README.md
index 508de2dfd..4c0876bc1 100644
--- a/problems/max-consecutive-ones-iii/README.md
+++ b/problems/max-consecutive-ones-iii/README.md
@@ -55,7 +55,7 @@ Bolded numbers were flipped from 0 to 1. The longest subarray is underlined.
[[Sliding Window](../../tag/sliding-window/README.md)]
### Similar Questions
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Hard)
+ 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
1. [Longest Repeating Character Replacement](../longest-repeating-character-replacement) (Medium)
1. [Max Consecutive Ones](../max-consecutive-ones) (Easy)
1. [Max Consecutive Ones II](../max-consecutive-ones-ii) (Medium)
diff --git a/problems/maximum-binary-string-after-change/README.md b/problems/maximum-binary-string-after-change/README.md
new file mode 100644
index 000000000..c12ef6abb
--- /dev/null
+++ b/problems/maximum-binary-string-after-change/README.md
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+[< Previous](../average-waiting-time "Average Waiting Time")
+
+[Next >](../minimum-adjacent-swaps-for-k-consecutive-ones "Minimum Adjacent Swaps for K Consecutive Ones")
+
+## [1702. Maximum Binary String After Change (Medium)](https://leetcode.com/problems/maximum-binary-string-after-change "修改后的最大二进制字符串")
+
+You are given a binary string binary
consisting of only 0
's or 1
's. You can apply each of the following operations any number of times:
+
+
+ - Operation 1: If the number contains the substring
"00"
, you can replace it with "10"
.
+
+ - For example,
"00010" -> "10010
"
+
+
+ - Operation 2: If the number contains the substring
"10"
, you can replace it with "01"
.
+
+ - For example,
"00010" -> "00001"
+
+
+
+
+Return the maximum binary string you can obtain after any number of operations. Binary string x
is greater than binary string y
if x
's decimal representation is greater than y
's decimal representation.
+
+
+Example 1:
+
+
+Input: binary = "000110"
+Output: "111011"
+Explanation: A valid transformation sequence can be:
+"000110" -> "000101"
+"000101" -> "100101"
+"100101" -> "110101"
+"110101" -> "110011"
+"110011" -> "111011"
+
+
+Example 2:
+
+
+Input: binary = "01"
+Output: "01"
+Explanation: "01" cannot be transformed any further.
+
+
+
+Constraints:
+
+
+ 1 <= binary.length <= 105
+ binary
consist of '0'
and '1'
.
+
+
+### Related Topics
+ [[Greedy](../../tag/greedy/README.md)]
+
+### Hints
+
+Hint 1
+Note that with the operations, you can always make the string only contain at most 1 zero.
+
diff --git a/problems/maximum-binary-tree/README.md b/problems/maximum-binary-tree/README.md
index 0c572f88c..13580bfb6 100644
--- a/problems/maximum-binary-tree/README.md
+++ b/problems/maximum-binary-tree/README.md
@@ -11,39 +11,39 @@
## [654. Maximum Binary Tree (Medium)](https://leetcode.com/problems/maximum-binary-tree "最大二叉树")
-
-Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:
+
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:
+
-- The root is the maximum number in the array.
-- The left subtree is the maximum tree constructed from left part subarray divided by the maximum number.
-- The right subtree is the maximum tree constructed from right part subarray divided by the maximum number.
+ - The root is the maximum number in the array.
+ - The left subtree is the maximum tree constructed from left part subarray divided by the maximum number.
+ - The right subtree is the maximum tree constructed from right part subarray divided by the maximum number.
-
-
-Construct the maximum tree by the given array and output the root node of this tree.
-
+Construct the maximum tree by the given array and output the root node of this tree.
-Example 1:
+
+Example 1:
+
-Input: [3,2,1,6,0,5]
-Output: return the tree root node representing the following tree:
-
- 6
- / \
- 3 5
- \ /
- 2 0
- \
- 1
+Input: nums = [3,2,1,6,0,5]
+Output: [6,3,5,null,2,0,null,null,1]
-
-Note:
-
-- The size of the given array will be in the range [1,1000].
-
-
+Example 2:
+
+
+Input: nums = [3,2,1]
+Output: [3,null,2,null,1]
+
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 1000
+ 0 <= nums[i] <= 1000
+ - All integers in
nums
are unique.
+
### Related Topics
[[Tree](../../tag/tree/README.md)]
diff --git a/problems/maximum-erasure-value/README.md b/problems/maximum-erasure-value/README.md
new file mode 100644
index 000000000..688835a6e
--- /dev/null
+++ b/problems/maximum-erasure-value/README.md
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+[< Previous](../reformat-phone-number "Reformat Phone Number")
+
+[Next >](../jump-game-vi "Jump Game VI")
+
+## [1695. Maximum Erasure Value (Medium)](https://leetcode.com/problems/maximum-erasure-value "删除子数组的最大得分")
+
+You are given an array of positive integers nums
and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements.
+
+Return the maximum score you can get by erasing exactly one subarray.
+
+An array b
is called to be a subarray of a
if it forms a contiguous subsequence of a
, that is, if it is equal to a[l],a[l+1],...,a[r]
for some (l,r)
.
+
+
+Example 1:
+
+
+Input: nums = [4,2,4,5,6]
+Output: 17
+Explanation: The optimal subarray here is [2,4,5,6].
+
+
+Example 2:
+
+
+Input: nums = [5,2,1,2,5,2,1,2,5]
+Output: 8
+Explanation: The optimal subarray here is [5,2,1] or [1,2,5].
+
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 105
+ 1 <= nums[i] <= 104
+
+
+### Related Topics
+ [[Two Pointers](../../tag/two-pointers/README.md)]
+
+### Hints
+
+Hint 1
+The main point here is for the subarray to contain unique elements for each index. Only the first subarrays starting from that index have unique elements.
+
+
+
+Hint 2
+This can be solved using the two pointers technique
+
diff --git a/problems/maximum-height-by-stacking-cuboids/README.md b/problems/maximum-height-by-stacking-cuboids/README.md
index 2f6182622..1d77d2dec 100644
--- a/problems/maximum-height-by-stacking-cuboids/README.md
+++ b/problems/maximum-height-by-stacking-cuboids/README.md
@@ -7,7 +7,7 @@
[< Previous](../stone-game-vii "Stone Game VII")
-Next >
+[Next >](../count-ways-to-distribute-candies "Count Ways to Distribute Candies")
## [1691. Maximum Height by Stacking Cuboids (Hard)](https://leetcode.com/problems/maximum-height-by-stacking-cuboids "堆叠长方体的最大高度")
diff --git a/problems/maximum-number-of-eaten-apples/README.md b/problems/maximum-number-of-eaten-apples/README.md
new file mode 100644
index 000000000..0c47a6301
--- /dev/null
+++ b/problems/maximum-number-of-eaten-apples/README.md
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+[< Previous](../determine-if-string-halves-are-alike "Determine if String Halves Are Alike")
+
+[Next >](../where-will-the-ball-fall "Where Will the Ball Fall")
+
+## [1705. Maximum Number of Eaten Apples (Medium)](https://leetcode.com/problems/maximum-number-of-eaten-apples "吃苹果的最大数目")
+
+There is a special kind of apple tree that grows apples every day for n
days. On the ith
day, the tree grows apples[i]
apples that will rot after days[i]
days, that is on day i + days[i]
the apples will be rotten and cannot be eaten. On some days, the apple tree does not grow any apples, which are denoted by apples[i] == 0
and days[i] == 0
.
+
+You decided to eat at most one apple a day (to keep the doctors away). Note that you can keep eating after the first n
days.
+
+Given two integer arrays days
and apples
of length n
, return the maximum number of apples you can eat.
+
+
+Example 1:
+
+
+Input: apples = [1,2,3,5,2], days = [3,2,1,4,2]
+Output: 7
+Explanation: You can eat 7 apples:
+- On the first day, you eat an apple that grew on the first day.
+- On the second day, you eat an apple that grew on the second day.
+- On the third day, you eat an apple that grew on the second day. After this day, the apples that grew on the third day rot.
+- On the fourth to the seventh days, you eat apples that grew on the fourth day.
+
+
+Example 2:
+
+
+Input: apples = [3,0,0,0,0,2], days = [3,0,0,0,0,2]
+Output: 5
+Explanation: You can eat 5 apples:
+- On the first to the third day you eat apples that grew on the first day.
+- Do nothing on the fouth and fifth days.
+- On the sixth and seventh days you eat apples that grew on the sixth day.
+
+
+
+Constraints:
+
+
+ apples.length == n
+ days.length == n
+ 1 <= n <= 2 * 104
+ 0 <= apples[i], days[i] <= 2 * 104
+ days[i] = 0
if and only if apples[i] = 0
.
+
+
+### Related Topics
+ [[Heap](../../tag/heap/README.md)]
+ [[Greedy](../../tag/greedy/README.md)]
+
+### Hints
+
+Hint 1
+It's optimal to finish the apples that will rot first before those that will rot last
+
+
+
+Hint 2
+You need a structure to keep the apples sorted by their finish time
+
diff --git a/problems/maximum-xor-with-an-element-from-array/README.md b/problems/maximum-xor-with-an-element-from-array/README.md
new file mode 100644
index 000000000..61cf253d5
--- /dev/null
+++ b/problems/maximum-xor-with-an-element-from-array/README.md
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+[< Previous](../where-will-the-ball-fall "Where Will the Ball Fall")
+
+Next >
+
+## [1707. Maximum XOR With an Element From Array (Hard)](https://leetcode.com/problems/maximum-xor-with-an-element-from-array "与数组中元素的最大异或值")
+
+You are given an array nums
consisting of non-negative integers. You are also given a queries
array, where queries[i] = [xi, mi]
.
+
+The answer to the ith
query is the maximum bitwise XOR
value of xi
and any element of nums
that does not exceed mi
. In other words, the answer is max(nums[j] XOR xi)
for all j
such that nums[j] <= mi
. If all elements in nums
are larger than mi
, then the answer is -1
.
+
+Return an integer array answer
where answer.length == queries.length
and answer[i]
is the answer to the ith
query.
+
+
+Example 1:
+
+
+Input: nums = [0,1,2,3,4], queries = [[3,1],[1,3],[5,6]]
+Output: [3,3,7]
+Explanation:
+1) 0 and 1 are the only two integers not greater than 1. 0 XOR 3 = 3 and 1 XOR 3 = 2. The larger of the two is 3.
+2) 1 XOR 2 = 3.
+3) 5 XOR 2 = 7.
+
+
+Example 2:
+
+
+Input: nums = [5,2,4,6,6,3], queries = [[12,4],[8,1],[6,3]]
+Output: [15,-1,5]
+
+
+
+Constraints:
+
+
+ 1 <= nums.length, queries.length <= 105
+ queries[i].length == 2
+ 0 <= nums[j], xi, mi <= 109
+
+
+### Related Topics
+ [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
+ [[Trie](../../tag/trie/README.md)]
+
+### Hints
+
+Hint 1
+In problems involving bitwise operations, we often think on the bits level. In this problem, we can think that to maximize the result of an xor operation, we need to maximize the most significant bit, then the next one, and so on.
+
+
+
+Hint 2
+If there's some number in the array that is less than m and whose the most significant bit is different than that of x, then xoring with this number maximizes the most significant bit, so I know this bit in the answer is 1.
+
+
+
+Hint 3
+To check the existence of such numbers and narrow your scope for further bits based on your choice, you can use trie.
+
+
+
+Hint 4
+You can sort the array and the queries, and maintain the trie such that in each query the trie consists exactly of the valid elements.
+
diff --git a/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md b/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md
new file mode 100644
index 000000000..41faceb26
--- /dev/null
+++ b/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+[< Previous](../maximum-binary-string-after-change "Maximum Binary String After Change")
+
+[Next >](../determine-if-string-halves-are-alike "Determine if String Halves Are Alike")
+
+## [1703. Minimum Adjacent Swaps for K Consecutive Ones (Hard)](https://leetcode.com/problems/minimum-adjacent-swaps-for-k-consecutive-ones "得到连续 K 个 1 的最少相邻交换次数")
+
+You are given an integer array, nums
, and an integer k
. nums
comprises of only 0
's and 1
's. In one move, you can choose two adjacent indices and swap their values.
+
+Return the minimum number of moves required so that nums
has k
consecutive 1
's.
+
+
+Example 1:
+
+
+Input: nums = [1,0,0,1,0,1], k = 2
+Output: 1
+Explanation: In 1 move, nums could be [1,0,0,0,1,1] and have 2 consecutive 1's.
+
+
+Example 2:
+
+
+Input: nums = [1,0,0,0,0,0,1,1], k = 3
+Output: 5
+Explanation: In 5 moves, the leftmost 1 can be shifted right until nums = [0,0,0,0,0,1,1,1].
+
+
+Example 3:
+
+
+Input: nums = [1,1,0,1], k = 2
+Output: 0
+Explanation: nums already has 2 consecutive 1's.
+
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 105
+ nums[i]
is 0
or 1
.
+ 1 <= k <= sum(nums)
+
+
+### Related Topics
+ [[Stack](../../tag/stack/README.md)]
+
+### Hints
+
+Hint 1
+Choose k 1s and determine how many steps are required to move them into 1 group.
+
+
+
+Hint 2
+Maintain a sliding window of k 1s, and maintain the steps required to group them.
+
+
+
+Hint 3
+When you slide the window across, should you move the group to the right? Once you move the group to the right, it will never need to slide to the left again.
+
diff --git a/problems/minimum-genetic-mutation/README.md b/problems/minimum-genetic-mutation/README.md
index 9ebb42a3c..87fca633e 100644
--- a/problems/minimum-genetic-mutation/README.md
+++ b/problems/minimum-genetic-mutation/README.md
@@ -68,4 +68,4 @@ return: 3
### Similar Questions
- 1. [Word Ladder](../word-ladder) (Medium)
+ 1. [Word Ladder](../word-ladder) (Hard)
diff --git a/problems/minimum-moves-to-equal-array-elements/README.md b/problems/minimum-moves-to-equal-array-elements/README.md
index 30e37eeb0..5ec44f81f 100644
--- a/problems/minimum-moves-to-equal-array-elements/README.md
+++ b/problems/minimum-moves-to-equal-array-elements/README.md
@@ -9,7 +9,7 @@
[Next >](../4sum-ii "4Sum II")
-## [453. Minimum Moves to Equal Array Elements (Easy)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements "最小移动次数使数组元素相等")
+## [453. Minimum Moves to Equal Array Elements (Easy)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements "最小操作次数使数组元素相等")
Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1.
diff --git a/problems/minimum-time-visiting-all-points/README.md b/problems/minimum-time-visiting-all-points/README.md
index bd6d6dc5f..b50308ecf 100644
--- a/problems/minimum-time-visiting-all-points/README.md
+++ b/problems/minimum-time-visiting-all-points/README.md
@@ -11,13 +11,20 @@
## [1266. Minimum Time Visiting All Points (Easy)](https://leetcode.com/problems/minimum-time-visiting-all-points "访问所有点的最小时间")
-On a plane there are n
points with integer coordinates points[i] = [xi, yi]
. Your task is to find the minimum time in seconds to visit all points.
+On a 2D plane, there are n
points with integer coordinates points[i] = [xi, yi]
. Return the minimum time in seconds to visit all the points in the order given by points
.
-You can move according to the next rules:
+You can move according to these rules:
- - In one second always you can either move vertically, horizontally by one unit or diagonally (it means to move one unit vertically and one unit horizontally in one second).
+ - In
1
second, you can either:
+
+ - move vertically by one unit,
+ - move horizontally by one unit, or
+ - move diagonally
sqrt(2)
units (in other words, move one unit vertically then one unit horizontally in 1
second).
+
+
- You have to visit the points in the same order as they appear in the array.
+ - You are allowed to pass through points that appear later in the order, but these do not count as visits.
diff --git a/problems/most-stones-removed-with-same-row-or-column/README.md b/problems/most-stones-removed-with-same-row-or-column/README.md
index 4be096fc6..8e45d05d1 100644
--- a/problems/most-stones-removed-with-same-row-or-column/README.md
+++ b/problems/most-stones-removed-with-same-row-or-column/README.md
@@ -11,49 +11,42 @@
## [947. Most Stones Removed with Same Row or Column (Medium)](https://leetcode.com/problems/most-stones-removed-with-same-row-or-column "移除最多的同行或同列石头")
-On a 2D plane, we place stones at some integer coordinate points. Each coordinate point may have at most one stone.
+On a 2D plane, we place stones
at some integer coordinate points. Each coordinate point may have at most one stone.
-Now, a move consists of removing a stone that shares a column or row with another stone on the grid.
+A move consists of removing a stone that shares a column or row with another stone on the grid.
-What is the largest possible number of moves we can make?
+Given an array stones
where stones[i] = [xi, yi]
, return the largest possible number of moves we can make.
-
-
Example 1:
-Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]
-Output: 5
+Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]
+Output: 5
-
Example 2:
-Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]
-Output: 3
+Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]
+Output: 3
-
Example 3:
-Input: stones = [[0,0]]
-Output: 0
+Input: stones = [[0,0]]
+Output: 0
+
Constraints:
-
Note:
-
-
+
1 <= stones.length <= 1000
- 0 <= stones[i][j] < 10000
-
-
-
-
+ 0 <= xi, yi < 104
+ stones
contains unique values.
+
### Related Topics
[[Depth-first Search](../../tag/depth-first-search/README.md)]
diff --git a/problems/nth-magical-number/README.md b/problems/nth-magical-number/README.md
index 88e9ae5b7..c7aaf6b59 100644
--- a/problems/nth-magical-number/README.md
+++ b/problems/nth-magical-number/README.md
@@ -11,60 +11,31 @@
## [878. Nth Magical Number (Hard)](https://leetcode.com/problems/nth-magical-number "第 N 个神奇数字")
-A positive integer is magical if it is divisible by either A or B.
+A positive integer is magical if it is divisible by either a
or b
.
-Return the N-th magical number. Since the answer may be very large, return it modulo 10^9 + 7
.
+Given the three integers n
, a
, and b
, return the nth
magical number. Since the answer may be very large, return it modulo 109 + 7
.
-
-
-
-
-
Example 1:
-
-
-Input: N = 1, A = 2, B = 3
-Output: 2
-
-
-
-
Example 2:
-
-
-Input: N = 4, A = 2, B = 3
-Output: 6
-
-
-
-
Example 3:
-
-
-Input: N = 5, A = 2, B = 4
-Output: 10
+Input: n = 1, a = 2, b = 3
+Output: 2
+
Example 2:
+Input: n = 4, a = 2, b = 3
+Output: 6
+
Example 3:
+Input: n = 5, a = 2, b = 4
+Output: 10
+
Example 4:
+Input: n = 3, a = 6, b = 4
+Output: 8
-
-
-
Example 4:
-
-
-Input: N = 3, A = 6, B = 4
-Output: 8
-
-
+
Constraints:
-
Note:
-
-
- 1 <= N <= 10^9
- 2 <= A <= 40000
- 2 <= B <= 40000
-
-
-
-
-
+
+ 1 <= n <= 109
+ 2 <= a, b <= 4 * 104
+
### Related Topics
[[Math](../../tag/math/README.md)]
diff --git a/problems/number-of-calls-between-two-persons/README.md b/problems/number-of-calls-between-two-persons/README.md
new file mode 100644
index 000000000..0a6b30900
--- /dev/null
+++ b/problems/number-of-calls-between-two-persons/README.md
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+[< Previous](../number-of-distinct-substrings-in-a-string "Number of Distinct Substrings in a String")
+
+[Next >](../number-of-students-unable-to-eat-lunch "Number of Students Unable to Eat Lunch")
+
+## [1699. Number of Calls Between Two Persons (Medium)](https://leetcode.com/problems/number-of-calls-between-two-persons "")
+
+
diff --git a/problems/number-of-calls-between-two-persons/mysql_schemas.sql b/problems/number-of-calls-between-two-persons/mysql_schemas.sql
new file mode 100644
index 000000000..d2578c68b
--- /dev/null
+++ b/problems/number-of-calls-between-two-persons/mysql_schemas.sql
@@ -0,0 +1,9 @@
+Create table If Not Exists Calls (from_id int, to_id int, duration int);
+Truncate table Calls;
+insert into Calls (from_id, to_id, duration) values ('1', '2', '59');
+insert into Calls (from_id, to_id, duration) values ('2', '1', '11');
+insert into Calls (from_id, to_id, duration) values ('1', '3', '20');
+insert into Calls (from_id, to_id, duration) values ('3', '4', '100');
+insert into Calls (from_id, to_id, duration) values ('3', '4', '200');
+insert into Calls (from_id, to_id, duration) values ('3', '4', '200');
+insert into Calls (from_id, to_id, duration) values ('4', '3', '499');
diff --git a/problems/number-of-digit-one/README.md b/problems/number-of-digit-one/README.md
index 787f8f7e0..7c3ca78c1 100644
--- a/problems/number-of-digit-one/README.md
+++ b/problems/number-of-digit-one/README.md
@@ -11,16 +11,30 @@
## [233. Number of Digit One (Hard)](https://leetcode.com/problems/number-of-digit-one "数字 1 的个数")
-Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.
+Given an integer n
, count the total number of digit 1
appearing in all non-negative integers less than or equal to n
.
-Example:
+
+Example 1:
-Input: 13
-Output: 6
-Explanation: Digit 1 occurred in the following numbers: 1, 10, 11, 12, 13.
+Input: n = 13
+Output: 6
+Example 2:
+
+
+Input: n = 0
+Output: 0
+
+
+
+Constraints:
+
+
+
### Related Topics
[[Math](../../tag/math/README.md)]
diff --git a/problems/number-of-distinct-substrings-in-a-string/README.md b/problems/number-of-distinct-substrings-in-a-string/README.md
new file mode 100644
index 000000000..568bad013
--- /dev/null
+++ b/problems/number-of-distinct-substrings-in-a-string/README.md
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+[< Previous](../checking-existence-of-edge-length-limited-paths "Checking Existence of Edge Length Limited Paths")
+
+[Next >](../number-of-calls-between-two-persons "Number of Calls Between Two Persons")
+
+## [1698. Number of Distinct Substrings in a String (Medium)](https://leetcode.com/problems/number-of-distinct-substrings-in-a-string "")
+
+
+
+### Related Topics
+ [[String](../../tag/string/README.md)]
+
+### Hints
+
+Hint 1
+Calculate the prefix hashing array for s.
+
+
+
+Hint 2
+Use the prefix hashing array to calculate the hashing value of each substring.
+
+
+
+Hint 3
+Compare the hashing values to determine the unique substrings.
+
+
+
+Hint 4
+There could be collisions if you use hashing, what about double hashing.
+
diff --git a/problems/number-of-students-unable-to-eat-lunch/README.md b/problems/number-of-students-unable-to-eat-lunch/README.md
new file mode 100644
index 000000000..8e0012d46
--- /dev/null
+++ b/problems/number-of-students-unable-to-eat-lunch/README.md
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+[< Previous](../number-of-calls-between-two-persons "Number of Calls Between Two Persons")
+
+[Next >](../average-waiting-time "Average Waiting Time")
+
+## [1700. Number of Students Unable to Eat Lunch (Easy)](https://leetcode.com/problems/number-of-students-unable-to-eat-lunch "无法吃午餐的学生数量")
+
+The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0
and 1
respectively. All students stand in a queue. Each student either prefers square or circular sandwiches.
+
+The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step:
+
+
+ - If the student at the front of the queue prefers the sandwich on the top of the stack, they will take it and leave the queue.
+ - Otherwise, they will leave it and go to the queue's end.
+
+
+This continues until none of the queue students want to take the top sandwich and are thus unable to eat.
+
+You are given two integer arrays students
and sandwiches
where sandwiches[i]
is the type of the ith
sandwich in the stack (i = 0
is the top of the stack) and students[j]
is the preference of the jth
student in the initial queue (j = 0
is the front of the queue). Return the number of students that are unable to eat.
+
+
+Example 1:
+
+
+Input: students = [1,1,0,0], sandwiches = [0,1,0,1]
+Output: 0
+Explanation:
+- Front student leaves the top sandwich and returns to the end of the line making students = [1,0,0,1].
+- Front student leaves the top sandwich and returns to the end of the line making students = [0,0,1,1].
+- Front student takes the top sandwich and leaves the line making students = [0,1,1] and sandwiches = [1,0,1].
+- Front student leaves the top sandwich and returns to the end of the line making students = [1,1,0].
+- Front student takes the top sandwich and leaves the line making students = [1,0] and sandwiches = [0,1].
+- Front student leaves the top sandwich and returns to the end of the line making students = [0,1].
+- Front student takes the top sandwich and leaves the line making students = [1] and sandwiches = [1].
+- Front student takes the top sandwich and leaves the line making students = [] and sandwiches = [].
+Hence all students are able to eat.
+
+
+Example 2:
+
+
+Input: students = [1,1,1,0,0,1], sandwiches = [1,0,0,0,1,1]
+Output: 3
+
+
+
+Constraints:
+
+
+ 1 <= students.length, sandwiches.length <= 100
+ students.length == sandwiches.length
+ sandwiches[i]
is 0
or 1
.
+ students[i]
is 0
or 1
.
+
+
+### Related Topics
+ [[Array](../../tag/array/README.md)]
+
+### Hints
+
+Hint 1
+Simulate the given in the statement
+
+
+
+Hint 2
+Calculate those who will eat instead of those who will not.
+
diff --git a/problems/numbers-with-same-consecutive-differences/README.md b/problems/numbers-with-same-consecutive-differences/README.md
index 049e40dcf..ce80e4f3c 100644
--- a/problems/numbers-with-same-consecutive-differences/README.md
+++ b/problems/numbers-with-same-consecutive-differences/README.md
@@ -13,7 +13,7 @@
Return all non-negative integers of length n
such that the absolute difference between every two consecutive digits is k
.
-Note that every number in the answer must not have leading zeros except for the number 0
itself. For example, 01
has one leading zero and is invalid, but 0
is valid.
+Note that every number in the answer must not have leading zeros. For example, 01
has one leading zero and is invalid.
You may return the answer in any order.
@@ -65,3 +65,5 @@
### Related Topics
[[Depth-first Search](../../tag/depth-first-search/README.md)]
[[Breadth-first Search](../../tag/breadth-first-search/README.md)]
+ [[Recursion](../../tag/recursion/README.md)]
+ [[Backtracking](../../tag/backtracking/README.md)]
diff --git a/problems/partition-array-into-three-parts-with-equal-sum/README.md b/problems/partition-array-into-three-parts-with-equal-sum/README.md
index 0d9a74fe5..44cc8fba4 100644
--- a/problems/partition-array-into-three-parts-with-equal-sum/README.md
+++ b/problems/partition-array-into-three-parts-with-equal-sum/README.md
@@ -11,15 +11,15 @@
## [1013. Partition Array Into Three Parts With Equal Sum (Easy)](https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum "将数组分成和相等的三个部分")
-Given an array A
of integers, return true
if and only if we can partition the array into three non-empty parts with equal sums.
+Given an array of integers arr
, return true
if we can partition the array into three non-empty parts with equal sums.
-Formally, we can partition the array if we can find indexes i+1 < j
with (A[0] + A[1] + ... + A[i] == A[i+1] + A[i+2] + ... + A[j-1] == A[j] + A[j-1] + ... + A[A.length - 1])
+Formally, we can partition the array if we can find indexes i + 1 < j
with (arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[arr.length - 1])
Example 1:
-Input: A = [0,2,1,-6,6,-7,9,1,2,0,1]
+Input: arr = [0,2,1,-6,6,-7,9,1,2,0,1]
Output: true
Explanation: 0 + 2 + 1 = -6 + 6 - 7 + 9 + 1 = 2 + 0 + 1
@@ -27,14 +27,14 @@
Example 2:
-Input: A = [0,2,1,-6,6,7,9,-1,2,0,1]
+Input: arr = [0,2,1,-6,6,7,9,-1,2,0,1]
Output: false
Example 3:
-Input: A = [3,3,6,5,-2,2,5,1,-9,4]
+Input: arr = [3,3,6,5,-2,2,5,1,-9,4]
Output: true
Explanation: 3 + 3 = 6 = 5 - 2 + 2 + 5 + 1 - 9 + 4
@@ -43,8 +43,8 @@
Constraints:
- 3 <= A.length <= 50000
- -10^4 <= A[i] <= 10^4
+ 3 <= arr.length <= 5 * 104
+ -104 <= arr[i] <= 104
### Related Topics
diff --git a/problems/previous-permutation-with-one-swap/README.md b/problems/previous-permutation-with-one-swap/README.md
index dffedec5a..053e6e743 100644
--- a/problems/previous-permutation-with-one-swap/README.md
+++ b/problems/previous-permutation-with-one-swap/README.md
@@ -11,50 +11,48 @@
## [1053. Previous Permutation With One Swap (Medium)](https://leetcode.com/problems/previous-permutation-with-one-swap "交换一次的先前排列")
-Given an array A
of positive integers (not necessarily distinct), return the lexicographically largest permutation that is smaller than A
, that can be made with one swap (A swap exchanges the positions of two numbers A[i]
and A[j]
). If it cannot be done, then return the same array.
+Given an array of positive integers arr
(not necessarily distinct), return the lexicographically largest permutation that is smaller than arr
, that can be made with exactly one swap (A swap exchanges the positions of two numbers arr[i]
and arr[j]
). If it cannot be done, then return the same array.
-
Example 1:
-Input: [3,2,1]
-Output: [3,1,2]
-Explanation: Swapping 2 and 1.
+Input: arr = [3,2,1]
+Output: [3,1,2]
+Explanation: Swapping 2 and 1.
Example 2:
-Input: [1,1,5]
-Output: [1,1,5]
-Explanation: This is already the smallest permutation.
+Input: arr = [1,1,5]
+Output: [1,1,5]
+Explanation: This is already the smallest permutation.
Example 3:
-Input: [1,9,4,6,7]
-Output: [1,7,4,6,9]
-Explanation: Swapping 9 and 7.
+Input: arr = [1,9,4,6,7]
+Output: [1,7,4,6,9]
+Explanation: Swapping 9 and 7.
Example 4:
-Input: [3,1,1,3]
-Output: [1,3,1,3]
-Explanation: Swapping 1 and 3.
+Input: arr = [3,1,1,3]
+Output: [1,3,1,3]
+Explanation: Swapping 1 and 3.
+Constraints:
-Note:
-
-
- 1 <= A.length <= 10000
- 1 <= A[i] <= 10000
-
+
+ 1 <= arr.length <= 104
+ 1 <= arr[i] <= 104
+
### Related Topics
[[Greedy](../../tag/greedy/README.md)]
diff --git a/problems/rectangle-area-ii/README.md b/problems/rectangle-area-ii/README.md
index eac757cc8..d96646f5c 100644
--- a/problems/rectangle-area-ii/README.md
+++ b/problems/rectangle-area-ii/README.md
@@ -11,35 +11,35 @@
## [850. Rectangle Area II (Hard)](https://leetcode.com/problems/rectangle-area-ii "矩形面积 II")
-We are given a list of (axis-aligned) rectangles
. Each rectangle[i] = [x1, y1, x2, y2]
, where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the i
th rectangle.
+We are given a list of (axis-aligned) rectangles
. Each rectangle[i] = [xi1, yi1, xi2, yi2]
, where (xi1, yi1)
are the coordinates of the bottom-left corner, and (xi2, yi2)
are the coordinates of the top-right corner of the ith
rectangle.
-Find the total area covered by all rectangles
in the plane. Since the answer may be too large, return it modulo 10^9 + 7.
-
-
+Find the total area covered by all rectangles
in the plane. Since the answer may be too large, return it modulo 109 + 7
.
+
Example 1:
-
+
-Input: [[0,0,2,2],[1,0,2,3],[1,0,3,1]]
-Output: 6
+Input: rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]]
+Output: 6
Explanation: As illustrated in the picture.
Example 2:
-Input: [[0,0,1000000000,1000000000]]
-Output: 49
-Explanation: The answer is 10^18 modulo (10^9 + 7), which is (10^9)^2 = (-7)^2 = 49.
+Input: rectangles = [[0,0,1000000000,1000000000]]
+Output: 49
+Explanation: The answer is 1018 modulo (109 + 7), which is (109)2 = (-7)2 = 49.
-Note:
+
+Constraints:
1 <= rectangles.length <= 200
rectanges[i].length = 4
- 0 <= rectangles[i][j] <= 10^9
- - The total area covered by all rectangles will never exceed
2^63 - 1
and thus will fit in a 64-bit signed integer.
+ 0 <= rectangles[i][j] <= 109
+ - The total area covered by all rectangles will never exceed
263 - 1
and thus will fit in a 64-bit signed integer.
### Related Topics
diff --git a/problems/redundant-connection-ii/README.md b/problems/redundant-connection-ii/README.md
index 32c267e4d..493b91de8 100644
--- a/problems/redundant-connection-ii/README.md
+++ b/problems/redundant-connection-ii/README.md
@@ -11,40 +11,38 @@
## [685. Redundant Connection II (Hard)](https://leetcode.com/problems/redundant-connection-ii "冗余连接 II")
-
-In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents.
-
-The given input is a directed graph that started as a rooted tree with N nodes (with distinct values 1, 2, ..., N), with one additional directed edge added. The added edge has two different vertices chosen from 1 to N, and was not an edge that already existed.
-
-The resulting graph is given as a 2D-array of edges
. Each element of edges
is a pair [u, v]
that represents a directed edge connecting nodes u
and v
, where u
is a parent of child v
.
-
-Return an edge that can be removed so that the resulting graph is a rooted tree of N nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array.
-
Example 1:
+
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents.
+
+The given input is a directed graph that started as a rooted tree with n
nodes (with distinct values from 1
to n
), with one additional directed edge added. The added edge has two different vertices chosen from 1
to n
, and was not an edge that already existed.
+
+The resulting graph is given as a 2D-array of edges
. Each element of edges
is a pair [ui, vi]
that represents a directed edge connecting nodes ui
and vi
, where ui
is a parent of child vi
.
+
+Return an edge that can be removed so that the resulting graph is a rooted tree of n
nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array.
+
+
+Example 1:
+
-Input: [[1,2], [1,3], [2,3]]
-Output: [2,3]
-Explanation: The given directed graph will be like this:
- 1
- / \
-v v
-2-->3
+Input: edges = [[1,2],[1,3],[2,3]]
+Output: [2,3]
-
-Example 2:
+
+
Example 2:
+
-Input: [[1,2], [2,3], [3,4], [4,1], [1,5]]
-Output: [4,1]
-Explanation: The given directed graph will be like this:
-5 <- 1 -> 2
- ^ |
- | v
- 4 <- 3
+Input: edges = [[1,2],[2,3],[3,4],[4,1],[1,5]]
+Output: [4,1]
-
-Note:
-
The size of the input 2D-array will be between 3 and 1000.
-Every integer represented in the 2D-array will be between 1 and N, where N is the size of the input array.
-
+
+
+Constraints:
+
+
+ n == edges.length
+ 3 <= n <= 1000
+ edges[i].length == 2
+ 1 <= ui, vi <= n
+
### Related Topics
[[Tree](../../tag/tree/README.md)]
diff --git a/problems/reformat-phone-number/README.md b/problems/reformat-phone-number/README.md
new file mode 100644
index 000000000..3efa683ad
--- /dev/null
+++ b/problems/reformat-phone-number/README.md
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+[< Previous](../daily-leads-and-partners "Daily Leads and Partners")
+
+[Next >](../maximum-erasure-value "Maximum Erasure Value")
+
+## [1694. Reformat Phone Number (Easy)](https://leetcode.com/problems/reformat-phone-number "重新格式化电话号码")
+
+You are given a phone number as a string number
. number
consists of digits, spaces ' '
, and/or dashes '-'
.
+
+You would like to reformat the phone number in a certain manner. Firstly, remove all spaces and dashes. Then, group the digits from left to right into blocks of length 3 until there are 4 or fewer digits. The final digits are then grouped as follows:
+
+
+ - 2 digits: A single block of length 2.
+ - 3 digits: A single block of length 3.
+ - 4 digits: Two blocks of length 2 each.
+
+
+The blocks are then joined by dashes. Notice that the reformatting process should never produce any blocks of length 1 and produce at most two blocks of length 2.
+
+Return the phone number after formatting.
+
+
+Example 1:
+
+
+Input: number = "1-23-45 6"
+Output: "123-456"
+Explanation: The digits are "123456".
+Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
+Step 2: There are 3 digits remaining, so put them in a single block of length 3. The 2nd block is "456".
+Joining the blocks gives "123-456".
+
+
+Example 2:
+
+
+Input: number = "123 4-567"
+Output: "123-45-67"
+Explanation: The digits are "1234567".
+Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
+Step 2: There are 4 digits left, so split them into two blocks of length 2. The blocks are "45" and "67".
+Joining the blocks gives "123-45-67".
+
+
+Example 3:
+
+
+Input: number = "123 4-5678"
+Output: "123-456-78"
+Explanation: The digits are "12345678".
+Step 1: The 1st block is "123".
+Step 2: The 2nd block is "456".
+Step 3: There are 2 digits left, so put them in a single block of length 2. The 3rd block is "78".
+Joining the blocks gives "123-456-78".
+
+
+Example 4:
+
+
+Input: number = "12"
+Output: "12"
+
+
+Example 5:
+
+
+Input: number = "--17-5 229 35-39475 "
+Output: "175-229-353-94-75"
+
+
+
+Constraints:
+
+
+ 2 <= number.length <= 100
+ number
consists of digits and the characters '-'
and ' '
.
+ - There are at least two digits in
number
.
+
+
+### Related Topics
+ [[String](../../tag/string/README.md)]
+
+### Hints
+
+Hint 1
+Discard all the spaces and dashes.
+
+
+
+Hint 2
+Use a while loop. While the string still has digits, check its length and see which rule to apply.
+
diff --git a/problems/remove-duplicates-from-sorted-array-ii/README.md b/problems/remove-duplicates-from-sorted-array-ii/README.md
index 0643564e0..a6766e6c0 100644
--- a/problems/remove-duplicates-from-sorted-array-ii/README.md
+++ b/problems/remove-duplicates-from-sorted-array-ii/README.md
@@ -55,7 +55,7 @@ for (int i = 0; i < len; i++) {
Constraints:
- 0 <= nums.length <= 3 * 104
+ 1 <= nums.length <= 3 * 104
-104 <= nums[i] <= 104
nums
is sorted in ascending order.
diff --git a/problems/remove-element/README.md b/problems/remove-element/README.md
index 06c8726eb..f9d2427bd 100644
--- a/problems/remove-element/README.md
+++ b/problems/remove-element/README.md
@@ -11,9 +11,9 @@
## [27. Remove Element (Easy)](https://leetcode.com/problems/remove-element "移除元素")
-Given an array nums and a value val, remove all instances of that value in-place and return the new length.
+Given an array nums and a value val
, remove all instances of that value in-place and return the new length.
-Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
+Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1)
extra memory.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
@@ -42,7 +42,7 @@ for (int i = 0; i < len; i++) {
Input: nums = [3,2,2,3], val = 3
Output: 2, nums = [2,2]
Explanation: Your function should return length = 2, with the first two elements of nums being 2.
-It doesn't matter what you leave beyond the returned length. For example if you return 2 with nums = [2,2,3,3] or nums = [2,3,0,0], your answer will be accepted.
+It doesn't matter what you leave beyond the returned length. For example if you return 2 with nums = [2,2,3,3] or nums = [2,2,0,0], your answer will be accepted.
Example 2:
diff --git a/problems/rising-temperature/README.md b/problems/rising-temperature/README.md
index 6eec734af..87eccc276 100644
--- a/problems/rising-temperature/README.md
+++ b/problems/rising-temperature/README.md
@@ -52,5 +52,5 @@ Result table:
| 4 |
+----+
In 2015-01-02, temperature was higher than the previous day (10 -> 25).
-In 2015-01-04, temperature was higher than the previous day (30 -> 20).
+In 2015-01-04, temperature was higher than the previous day (20 -> 30).
diff --git a/problems/same-tree/README.md b/problems/same-tree/README.md
index 162173b56..63caeb36f 100644
--- a/problems/same-tree/README.md
+++ b/problems/same-tree/README.md
@@ -11,46 +11,40 @@
## [100. Same Tree (Easy)](https://leetcode.com/problems/same-tree "相同的树")
-Given two binary trees, write a function to check if they are the same or not.
+Given the roots of two binary trees p
and q
, write a function to check if they are the same or not.
-Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
+Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
+
Example 1:
-
+
-Input: 1 1
- / \ / \
- 2 3 2 3
-
- [1,2,3], [1,2,3]
-
+Input: p = [1,2,3], q = [1,2,3]
Output: true
Example 2:
-
+
-Input: 1 1
- / \
- 2 2
-
- [1,2], [1,null,2]
-
+Input: p = [1,2], q = [1,null,2]
Output: false
Example 3:
-
+
-Input: 1 1
- / \ / \
- 2 1 1 2
-
- [1,2,1], [1,1,2]
-
+Input: p = [1,2,1], q = [1,1,2]
Output: false
+
+Constraints:
+
+
+ - The number of nodes in both trees is in the range
[0, 100]
.
+ -104 <= Node.val <= 104
+
+
### Related Topics
[[Tree](../../tag/tree/README.md)]
[[Depth-first Search](../../tag/depth-first-search/README.md)]
diff --git a/problems/search-a-2d-matrix/README.md b/problems/search-a-2d-matrix/README.md
index 70176897f..a17dcd2f6 100644
--- a/problems/search-a-2d-matrix/README.md
+++ b/problems/search-a-2d-matrix/README.md
@@ -22,21 +22,14 @@
Example 1:
-Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,50]], target = 3
+Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3
Output: true
Example 2:
-Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,50]], target = 13
-Output: false
-
-
-Example 3:
-
-
-Input: matrix = [], target = 0
+Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13
Output: false
@@ -46,7 +39,7 @@
m == matrix.length
n == matrix[i].length
- 0 <= m, n <= 100
+ 1 <= m, n <= 100
-104 <= matrix[i][j], target <= 104
diff --git a/problems/short-encoding-of-words/README.md b/problems/short-encoding-of-words/README.md
index c18dc8979..c45811240 100644
--- a/problems/short-encoding-of-words/README.md
+++ b/problems/short-encoding-of-words/README.md
@@ -11,13 +11,15 @@
## [820. Short Encoding of Words (Medium)](https://leetcode.com/problems/short-encoding-of-words "单词的压缩编码")
-Given a list of words
, we may encode it by writing a reference string s
and a list of indexes a
.
+A valid encoding of an array of words
is any reference string s
and array of indices indices
such that:
-For example, if the list of words
is ["time", "me", "bell"]
, we can write it as s = "time#bell#"
and indexes = [0, 2, 5]
.
-
-Then for each index, we will recover the word by reading from the reference string from that index until we reach a "#"
character.
+
+ words.length == indices.length
+ - The reference string
s
ends with the '#'
character.
+ - For each index
indices[i]
, the substring of s
starting from indices[i]
and up to (but not including) the next '#'
character is equal to words[i]
.
+
-Return the length of the shortest reference string s
possible that encodes the given words
.
+Given an array of words
, return the length of the shortest reference string s
possible of any valid encoding of words
.
Example 1:
@@ -25,7 +27,10 @@
Input: words = ["time", "me", "bell"]
Output: 10
-Explanation: s = "time#bell#" and indexes = [0, 2, 5
].
+Explanation: A valid encoding would be s = "time#bell#" and indices = [0, 2, 5
].
+words[0] = "time", the substring of s starting from indices[0] = 0 to the next '#' is underlined in "time#bell#"
+words[1] = "me", the substring of s starting from indices[1] = 2 to the next '#' is underlined in "time#bell#"
+words[2] = "bell", the substring of s starting from indices[2] = 5 to the next '#' is underlined in "time#bell#"
Example 2:
@@ -33,6 +38,8 @@
Input: words = ["t"]
Output: 2
+Explanation: A valid encoding would be s = "t#" and indices = [0].
+
diff --git a/problems/single-number-iii/README.md b/problems/single-number-iii/README.md
index 1052f6b57..8ff056aa4 100644
--- a/problems/single-number-iii/README.md
+++ b/problems/single-number-iii/README.md
@@ -42,8 +42,9 @@
Constraints:
- 1 <= nums.length <= 30000
- - Each integer in
nums
will appear twice, only two integers will appear once.
+ 2 <= nums.length <= 3 * 104
+ -231 <= nums[i] <= 231 - 1
+ - Each integer in
nums
will appear twice, only two integers will appear once.
### Related Topics
diff --git a/problems/sort-the-matrix-diagonally/README.md b/problems/sort-the-matrix-diagonally/README.md
index d99b12887..31bb6d3b4 100644
--- a/problems/sort-the-matrix-diagonally/README.md
+++ b/problems/sort-the-matrix-diagonally/README.md
@@ -11,7 +11,9 @@
## [1329. Sort the Matrix Diagonally (Medium)](https://leetcode.com/problems/sort-the-matrix-diagonally "将矩阵按对角线排序")
-Given a m * n
matrix mat
of integers, sort it diagonally in ascending order from the top-left to the bottom-right then return the sorted array.
+A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, the matrix diagonal starting from mat[2][0]
, where mat
is a 6 x 3
matrix, includes cells mat[2][0]
, mat[3][1]
, and mat[4][2]
.
+
+Given an m x n
matrix mat
of integers, sort each matrix diagonal in ascending order and return the resulting matrix.
Example 1:
diff --git a/problems/stone-game-vi/README.md b/problems/stone-game-vi/README.md
index ee65e1a73..62f6a7854 100644
--- a/problems/stone-game-vi/README.md
+++ b/problems/stone-game-vi/README.md
@@ -17,7 +17,7 @@
You are given two integer arrays of length n
, aliceValues
and bobValues
. Each aliceValues[i]
and bobValues[i]
represents how Alice and Bob, respectively, value the ith
stone.
-The winner is the person with the most points after all the stones are chosen. If both players have the same amount of points, the game results in a draw. Both players will play optimally.
+The winner is the person with the most points after all the stones are chosen. If both players have the same amount of points, the game results in a draw. Both players will play optimally. Both players know the other's values.
Determine the result of the game, and:
diff --git a/problems/string-without-aaa-or-bbb/README.md b/problems/string-without-aaa-or-bbb/README.md
index a252e92b6..6be32faa8 100644
--- a/problems/string-without-aaa-or-bbb/README.md
+++ b/problems/string-without-aaa-or-bbb/README.md
@@ -11,41 +11,37 @@
## [984. String Without AAA or BBB (Medium)](https://leetcode.com/problems/string-without-aaa-or-bbb "不含 AAA 或 BBB 的字符串")
-Given two integers A
and B
, return any string S
such that:
+Given two integers a
and b
, return any string s
such that:
- S
has length A + B
and contains exactly A
'a'
letters, and exactly B
'b'
letters;
- - The substring
'aaa'
does not occur in S
;
- - The substring
'bbb'
does not occur in S
.
+ s
has length a + b
and contains exactly a
'a'
letters, and exactly b
'b'
letters,
+ - The substring
'aaa'
does not occur in s
, and
+ - The substring
'bbb'
does not occur in s
.
-
Example 1:
-Input: A = 1, B = 2
-Output: "abb"
-Explanation: "abb", "bab" and "bba" are all correct answers.
+Input: a = 1, b = 2
+Output: "abb"
+Explanation: "abb", "bab" and "bba" are all correct answers.
-
Example 2:
-Input: A = 4, B = 1
-Output: "aabaa"
+
Input: a = 4, b = 1
+
Output: "aabaa"
+
-
-
-Note:
+Constraints:
-
- 0 <= A <= 100
- 0 <= B <= 100
- - It is guaranteed such an
S
exists for the given A
and B
.
-
+
+ 0 <= a, b <= 100
+ - It is guaranteed such an
s
exists for the given a
and b
.
+
### Related Topics
[[Greedy](../../tag/greedy/README.md)]
diff --git a/problems/subarrays-with-k-different-integers/README.md b/problems/subarrays-with-k-different-integers/README.md
index 0ca5646b9..baa2312b3 100644
--- a/problems/subarrays-with-k-different-integers/README.md
+++ b/problems/subarrays-with-k-different-integers/README.md
@@ -53,4 +53,4 @@
### Similar Questions
1. [Longest Substring Without Repeating Characters](../longest-substring-without-repeating-characters) (Medium)
1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Hard)
+ 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
diff --git a/problems/swap-nodes-in-pairs/README.md b/problems/swap-nodes-in-pairs/README.md
index aa9588786..a16086aa5 100644
--- a/problems/swap-nodes-in-pairs/README.md
+++ b/problems/swap-nodes-in-pairs/README.md
@@ -46,6 +46,7 @@
### Related Topics
+ [[Recursion](../../tag/recursion/README.md)]
[[Linked List](../../tag/linked-list/README.md)]
### Similar Questions
diff --git a/problems/triangle/README.md b/problems/triangle/README.md
index eaf8a2655..d7612fbb3 100644
--- a/problems/triangle/README.md
+++ b/problems/triangle/README.md
@@ -11,24 +11,38 @@
## [120. Triangle (Medium)](https://leetcode.com/problems/triangle "三角形最小路径和")
-Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
+Given a triangle
array, return the minimum path sum from top to bottom.
-For example, given the following triangle
+For each step, you may move to an adjacent number on the row below.
+
+
+Example 1:
+
+
+Input: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]
+Output: 11
+Explanation: The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11).
+
+
+Example 2:
-[
- [2],
- [3,4],
- [6,5,7],
- [4,1,8,3]
-]
+Input: triangle = [[-10]]
+Output: -10
-The minimum path sum from top to bottom is 11
(i.e., 2 + 3 + 5 + 1 = 11).
+
+Constraints:
-Note:
+
+ 1 <= triangle.length <= 200
+ triangle[0].length == 1
+ triangle[i].length == triangle[i - 1].length + 1
+ -104 <= triangle[i][j] <= 104
+
-Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the triangle.
+
+Follow up: Could you do this using only O(n)
extra space, where n
is the total number of rows in the triangle?
### Related Topics
[[Array](../../tag/array/README.md)]
diff --git a/problems/valid-mountain-array/README.md b/problems/valid-mountain-array/README.md
index c194f6c86..ce394ccd2 100644
--- a/problems/valid-mountain-array/README.md
+++ b/problems/valid-mountain-array/README.md
@@ -11,15 +11,15 @@
## [941. Valid Mountain Array (Easy)](https://leetcode.com/problems/valid-mountain-array "有效的山脉数组")
-Given an array of integers arr
, return true
if and only if it is a valid mountain array.
+Given an array of integers arr
, return true
if and only if it is a valid mountain array.
Recall that arr is a mountain array if and only if:
arr.length >= 3
- - There exists some
i
with 0 < i < arr.length - 1
such that:
+ - There exists some
i
with 0 < i < arr.length - 1
such that:
- arr[0] < arr[1] < ... < arr[i - 1] < A[i]
+ arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
diff --git a/problems/where-will-the-ball-fall/README.md b/problems/where-will-the-ball-fall/README.md
new file mode 100644
index 000000000..ee6f59080
--- /dev/null
+++ b/problems/where-will-the-ball-fall/README.md
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+[< Previous](../maximum-number-of-eaten-apples "Maximum Number of Eaten Apples")
+
+[Next >](../maximum-xor-with-an-element-from-array "Maximum XOR With an Element From Array")
+
+## [1706. Where Will the Ball Fall (Medium)](https://leetcode.com/problems/where-will-the-ball-fall "球会落何处")
+
+You have a 2-D grid
of size m x n
representing a box, and you have n
balls. The box is open on the top and bottom sides.
+
+Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left.
+
+
+ - A board that redirects the ball to the right spans the top-left corner to the bottom-right corner and is represented in the grid as
1
.
+ - A board that redirects the ball to the left spans the top-right corner to the bottom-left corner and is represented in the grid as
-1
.
+
+
+We drop one ball at the top of each column of the box. Each ball can get stuck in the box or fall out of the bottom. A ball gets stuck if it hits a "V" shaped pattern between two boards or if a board redirects the ball into either wall of the box.
+
+Return an array answer
of size n
where answer[i]
is the column that the ball falls out of at the bottom after dropping the ball from the ith
column at the top, or -1
if the ball gets stuck in the box.
+
+
+Example 1:
+
+
+
+
+Input: grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]
+Output: [1,-1,-1,-1,-1]
+Explanation: This example is shown in the photo.
+Ball b0 is dropped at column 0 and falls out of the box at column 1.
+Ball b1 is dropped at column 1 and will get stuck in the box between column 2 and 3 and row 1.
+Ball b2 is dropped at column 2 and will get stuck on the box between column 2 and 3 and row 0.
+Ball b3 is dropped at column 3 and will get stuck on the box between column 2 and 3 and row 0.
+Ball b4 is dropped at column 4 and will get stuck on the box between column 2 and 3 and row 1.
+
+
+Example 2:
+
+
+Input: grid = [[-1]]
+Output: [-1]
+Explanation: The ball gets stuck against the left wall.
+
+
+
+Constraints:
+
+
+ m == grid.length
+ n == grid[i].length
+ 1 <= m, n <= 100
+ grid[i][j]
is 1
or -1
.
+
+
+### Related Topics
+ [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
+
+### Hints
+
+Hint 1
+Use DFS.
+
+
+
+Hint 2
+Traverse the path of the ball downwards until you reach the bottom or get stuck.
+
diff --git a/problems/word-ladder-ii/README.md b/problems/word-ladder-ii/README.md
index 89166942d..89a3a383f 100644
--- a/problems/word-ladder-ii/README.md
+++ b/problems/word-ladder-ii/README.md
@@ -66,4 +66,4 @@ wordList = ["hot","dot","dog","lot",&quo
[[Backtracking](../../tag/backtracking/README.md)]
### Similar Questions
- 1. [Word Ladder](../word-ladder) (Medium)
+ 1. [Word Ladder](../word-ladder) (Hard)
diff --git a/problems/word-ladder/README.md b/problems/word-ladder/README.md
index 008dce79f..da04e85e8 100644
--- a/problems/word-ladder/README.md
+++ b/problems/word-ladder/README.md
@@ -9,53 +9,45 @@
[Next >](../longest-consecutive-sequence "Longest Consecutive Sequence")
-## [127. Word Ladder (Medium)](https://leetcode.com/problems/word-ladder "单词接龙")
+## [127. Word Ladder (Hard)](https://leetcode.com/problems/word-ladder "单词接龙")
-Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
+Given two words beginWord
and endWord
, and a dictionary wordList
, return the length of the shortest transformation sequence from beginWord
to endWord
, such that:
-
+
- Only one letter can be changed at a time.
- Each transformed word must exist in the word list.
-
-
-Note:
-
-
- - Return 0 if there is no such transformation sequence.
- - All words have the same length.
- - All words contain only lowercase alphabetic characters.
- - You may assume no duplicates in the word list.
- - You may assume beginWord and endWord are non-empty and are not the same.
+Return 0
if there is no such transformation sequence.
+
+
Example 1:
-Input:
-beginWord = "hit",
-endWord = "cog",
-wordList = ["hot","dot","dog","lot","log","cog"]
-
-Output: 5
-
-Explanation: As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
-return its length 5.
+Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
+Output: 5
+Explanation: As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog", return its length 5.
Example 2:
-Input:
-beginWord = "hit"
-endWord = "cog"
-wordList = ["hot","dot","dog","lot","log"]
-
-Output: 0
-
-Explanation: The endWord "cog" is not in wordList, therefore no possible transformation.
+Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
+Output: 0
+Explanation: The endWord "cog" is not in wordList, therefore no possible transformation.
+
+Constraints:
+
+ 1 <= beginWord.length <= 100
+ endWord.length == beginWord.length
+ 1 <= wordList.length <= 5000
+ wordList[i].length == beginWord.length
+ beginWord
, endWord
, and wordList[i]
consist of lowercase English letters.
+ beginWord != endWord
+ - All the strings in
wordList
are unique.
### Related Topics
diff --git a/readme/1-300.md b/readme/1-300.md
index 12363d525..63d054eac 100644
--- a/readme/1-300.md
+++ b/readme/1-300.md
@@ -172,11 +172,11 @@ LeetCode Problems' Solutions
| 100 | [Same Tree](https://leetcode.com/problems/same-tree "相同的树") | [Go](../problems/same-tree) | Easy |
| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree "对称二叉树") | [Go](../problems/symmetric-tree) | Easy |
| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层序遍历") | [Go](../problems/binary-tree-level-order-traversal) | Medium |
-| 103 | [Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal "二叉树的锯齿形层次遍历") | [Go](../problems/binary-tree-zigzag-level-order-traversal) | Medium |
+| 103 | [Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal "二叉树的锯齿形层序遍历") | [Go](../problems/binary-tree-zigzag-level-order-traversal) | Medium |
| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree "二叉树的最大深度") | [Go](../problems/maximum-depth-of-binary-tree) | Easy |
| 105 | [Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal "从前序与中序遍历序列构造二叉树") | [Go](../problems/construct-binary-tree-from-preorder-and-inorder-traversal) | Medium |
| 106 | [Construct Binary Tree from Inorder and Postorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal "从中序与后序遍历序列构造二叉树") | [Go](../problems/construct-binary-tree-from-inorder-and-postorder-traversal) | Medium |
-| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii "二叉树的层次遍历 II") | [Go](../problems/binary-tree-level-order-traversal-ii) | Easy |
+| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii "二叉树的层序遍历 II") | [Go](../problems/binary-tree-level-order-traversal-ii) | Easy |
| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree "将有序数组转换为二叉搜索树") | [Go](../problems/convert-sorted-array-to-binary-search-tree) | Easy |
| 109 | [Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree "有序链表转换二叉搜索树") | [Go](../problems/convert-sorted-list-to-binary-search-tree) | Medium |
| 110 | [Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree "平衡二叉树") | [Go](../problems/balanced-binary-tree) | Easy |
@@ -196,7 +196,7 @@ LeetCode Problems' Solutions
| 124 | [Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum "二叉树中的最大路径和") | [Go](../problems/binary-tree-maximum-path-sum) | Hard |
| 125 | [Valid Palindrome](https://leetcode.com/problems/valid-palindrome "验证回文串") | [Go](../problems/valid-palindrome) | Easy |
| 126 | [Word Ladder II](https://leetcode.com/problems/word-ladder-ii "单词接龙 II") | [Go](../problems/word-ladder-ii) | Hard |
-| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder "单词接龙") | [Go](../problems/word-ladder) | Medium |
+| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder "单词接龙") | [Go](../problems/word-ladder) | Hard |
| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence "最长连续序列") | [Go](../problems/longest-consecutive-sequence) | Hard |
| 129 | [Sum Root to Leaf Numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers "求根到叶子节点数字之和") | [Go](../problems/sum-root-to-leaf-numbers) | Medium |
| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions "被围绕的区域") | [Go](../problems/surrounded-regions) | Medium |
@@ -267,7 +267,7 @@ LeetCode Problems' Solutions
| 195 | [Tenth Line](https://leetcode.com/problems/tenth-line "第十行") | [Bash](../problems/tenth-line) | Easy |
| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails "删除重复的电子邮箱") | [MySQL](../problems/delete-duplicate-emails) | Easy |
| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature "上升的温度") | [MySQL](../problems/rising-temperature) | Easy |
-| 198 | [House Robber](https://leetcode.com/problems/house-robber "打家劫舍") | [Go](../problems/house-robber) | Easy |
+| 198 | [House Robber](https://leetcode.com/problems/house-robber "打家劫舍") | [Go](../problems/house-robber) | Medium |
| 199 | [Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view "二叉树的右视图") | [Go](../problems/binary-tree-right-side-view) | Medium |
| 200 | [Number of Islands](https://leetcode.com/problems/number-of-islands "岛屿数量") | [Go](../problems/number-of-islands) | Medium |
| 201 | [Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range "数字范围按位与") | [Go](../problems/bitwise-and-of-numbers-range) | Medium |
@@ -369,4 +369,4 @@ LeetCode Problems' Solutions
| 297 | [Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree "二叉树的序列化与反序列化") | [Go](../problems/serialize-and-deserialize-binary-tree) | Hard |
| 298 | [Binary Tree Longest Consecutive Sequence](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence "二叉树最长连续序列") 🔒 | [Go](../problems/binary-tree-longest-consecutive-sequence) | Medium |
| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows "猜数字游戏") | [Go](../problems/bulls-and-cows) | Medium |
-| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence "最长上升子序列") | [Go](../problems/longest-increasing-subsequence) | Medium |
+| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence "最长递增子序列") | [Go](../problems/longest-increasing-subsequence) | Medium |
diff --git a/readme/301-600.md b/readme/301-600.md
index 76dc35af2..fb99096b5 100644
--- a/readme/301-600.md
+++ b/readme/301-600.md
@@ -109,7 +109,7 @@ LeetCode Problems' Solutions
| 337 | [House Robber III](https://leetcode.com/problems/house-robber-iii "打家劫舍 III") | [Go](../problems/house-robber-iii) | Medium |
| 338 | [Counting Bits](https://leetcode.com/problems/counting-bits "比特位计数") | [Go](../problems/counting-bits) | Medium |
| 339 | [Nested List Weight Sum](https://leetcode.com/problems/nested-list-weight-sum "嵌套列表权重和") 🔒 | [Go](../problems/nested-list-weight-sum) | Easy |
-| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters "至多包含 K 个不同字符的最长子串") 🔒 | [Go](../problems/longest-substring-with-at-most-k-distinct-characters) | Hard |
+| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters "至多包含 K 个不同字符的最长子串") 🔒 | [Go](../problems/longest-substring-with-at-most-k-distinct-characters) | Medium |
| 341 | [Flatten Nested List Iterator](https://leetcode.com/problems/flatten-nested-list-iterator "扁平化嵌套列表迭代器") | [Go](../problems/flatten-nested-list-iterator) | Medium |
| 342 | [Power of Four](https://leetcode.com/problems/power-of-four "4的幂") | [Go](../problems/power-of-four) | Easy |
| 343 | [Integer Break](https://leetcode.com/problems/integer-break "整数拆分") | [Go](../problems/integer-break) | Medium |
@@ -222,7 +222,7 @@ LeetCode Problems' Solutions
| 450 | [Delete Node in a BST](https://leetcode.com/problems/delete-node-in-a-bst "删除二叉搜索树中的节点") | [Go](../problems/delete-node-in-a-bst) | Medium |
| 451 | [Sort Characters By Frequency](https://leetcode.com/problems/sort-characters-by-frequency "根据字符出现频率排序") | [Go](../problems/sort-characters-by-frequency) | Medium |
| 452 | [Minimum Number of Arrows to Burst Balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons "用最少数量的箭引爆气球") | [Go](../problems/minimum-number-of-arrows-to-burst-balloons) | Medium |
-| 453 | [Minimum Moves to Equal Array Elements](https://leetcode.com/problems/minimum-moves-to-equal-array-elements "最小移动次数使数组元素相等") | [Go](../problems/minimum-moves-to-equal-array-elements) | Easy |
+| 453 | [Minimum Moves to Equal Array Elements](https://leetcode.com/problems/minimum-moves-to-equal-array-elements "最小操作次数使数组元素相等") | [Go](../problems/minimum-moves-to-equal-array-elements) | Easy |
| 454 | [4Sum II](https://leetcode.com/problems/4sum-ii "四数相加 II") | [Go](../problems/4sum-ii) | Medium |
| 455 | [Assign Cookies](https://leetcode.com/problems/assign-cookies "分发饼干") | [Go](../problems/assign-cookies) | Easy |
| 456 | [132 Pattern](https://leetcode.com/problems/132-pattern "132模式") | [Go](../problems/132-pattern) | Medium |
@@ -366,7 +366,7 @@ LeetCode Problems' Solutions
| 594 | [Longest Harmonious Subsequence](https://leetcode.com/problems/longest-harmonious-subsequence "最长和谐子序列") | [Go](../problems/longest-harmonious-subsequence) | Easy |
| 595 | [Big Countries](https://leetcode.com/problems/big-countries "大的国家") | [MySQL](../problems/big-countries) | Easy |
| 596 | [Classes More Than 5 Students](https://leetcode.com/problems/classes-more-than-5-students "超过5名学生的课") | [MySQL](../problems/classes-more-than-5-students) | Easy |
-| 597 | [Friend Requests I: Overall Acceptance Rate](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate "好友申请 I :总体通过率") 🔒 | [MySQL](../problems/friend-requests-i-overall-acceptance-rate) | Easy |
+| 597 | [Friend Requests I: Overall Acceptance Rate](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate "好友申请 I:总体通过率") 🔒 | [MySQL](../problems/friend-requests-i-overall-acceptance-rate) | Easy |
| 598 | [Range Addition II](https://leetcode.com/problems/range-addition-ii "范围求和 II") | [Go](../problems/range-addition-ii) | Easy |
| 599 | [Minimum Index Sum of Two Lists](https://leetcode.com/problems/minimum-index-sum-of-two-lists "两个列表的最小索引总和") | [Go](../problems/minimum-index-sum-of-two-lists) | Easy |
| 600 | [Non-negative Integers without Consecutive Ones](https://leetcode.com/problems/non-negative-integers-without-consecutive-ones "不含连续1的非负整数") | [Go](../problems/non-negative-integers-without-consecutive-ones) | Hard |
diff --git a/tag/README.md b/tag/README.md
index aee906df4..44eea5ddf 100644
--- a/tag/README.md
+++ b/tag/README.md
@@ -19,7 +19,7 @@
| 15 | [Design](design/README.md) | [设计](https://openset.github.io/tags/design/) | | 16 | [Bit Manipulation](bit-manipulation/README.md) | [位运算](https://openset.github.io/tags/bit-manipulation/) |
| 17 | [Graph](graph/README.md) | [图](https://openset.github.io/tags/graph/) | | 18 | [Linked List](linked-list/README.md) | [链表](https://openset.github.io/tags/linked-list/) |
| 19 | [Heap](heap/README.md) | [堆](https://openset.github.io/tags/heap/) | | 20 | [Union Find](union-find/README.md) | [并查集](https://openset.github.io/tags/union-find/) |
-| 21 | [Sliding Window](sliding-window/README.md) | [Sliding Window](https://openset.github.io/tags/sliding-window/) | | 22 | [Recursion](recursion/README.md) | [递归](https://openset.github.io/tags/recursion/) |
+| 21 | [Recursion](recursion/README.md) | [递归](https://openset.github.io/tags/recursion/) | | 22 | [Sliding Window](sliding-window/README.md) | [Sliding Window](https://openset.github.io/tags/sliding-window/) |
| 23 | [Divide and Conquer](divide-and-conquer/README.md) | [分治算法](https://openset.github.io/tags/divide-and-conquer/) | | 24 | [Trie](trie/README.md) | [字典树](https://openset.github.io/tags/trie/) |
| 25 | [Segment Tree](segment-tree/README.md) | [线段树](https://openset.github.io/tags/segment-tree/) | | 26 | [Ordered Map](ordered-map/README.md) | [Ordered Map](https://openset.github.io/tags/ordered-map/) |
| 27 | [Geometry](geometry/README.md) | [几何](https://openset.github.io/tags/geometry/) | | 28 | [Queue](queue/README.md) | [队列](https://openset.github.io/tags/queue/) |
@@ -27,6 +27,6 @@
| 31 | [Brainteaser](brainteaser/README.md) | [脑筋急转弯](https://openset.github.io/tags/brainteaser/) | | 32 | [Line Sweep](line-sweep/README.md) | [Line Sweep](https://openset.github.io/tags/line-sweep/) |
| 33 | [Random](random/README.md) | [Random](https://openset.github.io/tags/random/) | | 34 | [Topological Sort](topological-sort/README.md) | [拓扑排序](https://openset.github.io/tags/topological-sort/) |
| 35 | [Binary Search Tree](binary-search-tree/README.md) | [二叉搜索树](https://openset.github.io/tags/binary-search-tree/) | | 36 | [](dequeue/README.md) | [](https://openset.github.io/tags/dequeue/) |
-| 37 | [Rolling Hash](rolling-hash/README.md) | [Rolling Hash](https://openset.github.io/tags/rolling-hash/) | | 38 | [Rejection Sampling](rejection-sampling/README.md) | [Rejection Sampling](https://openset.github.io/tags/rejection-sampling/) |
-| 39 | [Reservoir Sampling](reservoir-sampling/README.md) | [蓄水池抽样](https://openset.github.io/tags/reservoir-sampling/) | | 40 | [Suffix Array](suffix-array/README.md) | [Suffix Array](https://openset.github.io/tags/suffix-array/) |
+| 37 | [Rolling Hash](rolling-hash/README.md) | [Rolling Hash](https://openset.github.io/tags/rolling-hash/) | | 38 | [Suffix Array](suffix-array/README.md) | [Suffix Array](https://openset.github.io/tags/suffix-array/) |
+| 39 | [Rejection Sampling](rejection-sampling/README.md) | [Rejection Sampling](https://openset.github.io/tags/rejection-sampling/) | | 40 | [Reservoir Sampling](reservoir-sampling/README.md) | [蓄水池抽样](https://openset.github.io/tags/reservoir-sampling/) |
| 41 | [Memoization](memoization/README.md) | [记忆化](https://openset.github.io/tags/memoization/) | | 42 | [](oop/README.md) | [](https://openset.github.io/tags/oop/) |
diff --git a/tag/array/README.md b/tag/array/README.md
index 637095778..db6a5e763 100644
--- a/tag/array/README.md
+++ b/tag/array/README.md
@@ -9,6 +9,8 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1701 | [平均等待时间](../../problems/average-waiting-time) | [[数组](../array/README.md)] | Medium |
+| 1700 | [无法吃午餐的学生数量](../../problems/number-of-students-unable-to-eat-lunch) | [[数组](../array/README.md)] | Easy |
| 1672 | [最富有客户的资产总量](../../problems/richest-customer-wealth) | [[数组](../array/README.md)] | Easy |
| 1656 | [设计有序流](../../problems/design-an-ordered-stream) | [[设计](../design/README.md)] [[数组](../array/README.md)] | Easy |
| 1652 | [拆炸弹](../../problems/defuse-the-bomb) | [[数组](../array/README.md)] | Easy |
diff --git a/tag/backtracking/README.md b/tag/backtracking/README.md
index 1d67a2924..fce6888d9 100644
--- a/tag/backtracking/README.md
+++ b/tag/backtracking/README.md
@@ -32,6 +32,7 @@
| 1066 | [校园自行车分配 II](../../problems/campus-bikes-ii) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 996 | [正方形数组的数目](../../problems/number-of-squareful-arrays) | [[图](../graph/README.md)] [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
| 980 | [不同路径 III](../../problems/unique-paths-iii) | [[深度优先搜索](../depth-first-search/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
+| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 842 | [将数组拆分成斐波那契序列](../../problems/split-array-into-fibonacci-sequence) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 797 | [所有可能的路径](../../problems/all-paths-from-source-to-target) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 784 | [字母大小写全排列](../../problems/letter-case-permutation) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
diff --git a/tag/binary-search/README.md b/tag/binary-search/README.md
index 4c89615a8..155852663 100644
--- a/tag/binary-search/README.md
+++ b/tag/binary-search/README.md
@@ -82,7 +82,7 @@
| 327 | [区间和的个数](../../problems/count-of-range-sum) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
| 315 | [计算右侧小于当前元素的个数](../../problems/count-of-smaller-numbers-after-self) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
| 302 | [包含全部黑色像素的最小矩形](../../problems/smallest-rectangle-enclosing-black-pixels) 🔒 | [[二分查找](../binary-search/README.md)] | Hard |
-| 300 | [最长上升子序列](../../problems/longest-increasing-subsequence) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
+| 300 | [最长递增子序列](../../problems/longest-increasing-subsequence) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
| 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
| 278 | [第一个错误的版本](../../problems/first-bad-version) | [[二分查找](../binary-search/README.md)] | Easy |
| 275 | [H 指数 II](../../problems/h-index-ii) | [[二分查找](../binary-search/README.md)] | Medium |
diff --git a/tag/bit-manipulation/README.md b/tag/bit-manipulation/README.md
index 0406a0869..fc676bb79 100644
--- a/tag/bit-manipulation/README.md
+++ b/tag/bit-manipulation/README.md
@@ -9,3 +9,58 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1707 | [与数组中元素的最大异或值](../../problems/maximum-xor-with-an-element-from-array) | [[位运算](../bit-manipulation/README.md)] [[字典树](../trie/README.md)] | Hard |
+| 1611 | [使整数变为 0 的最少操作次数](../../problems/minimum-one-bit-operations-to-make-integers-zero) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 1542 | [找出最长的超赞子字符串](../../problems/find-longest-awesome-substring) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Hard |
+| 1525 | [字符串的好分割数目](../../problems/number-of-good-ways-to-split-a-string) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
+| 1521 | [找到最接近目标值的函数值](../../problems/find-a-value-of-a-mysterious-function-closest-to-target) | [[位运算](../bit-manipulation/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] | Hard |
+| 1486 | [数组异或操作](../../problems/xor-operation-in-an-array) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] | Easy |
+| 1461 | [检查一个字符串是否包含所有长度为 K 的二进制子串](../../problems/check-if-a-string-contains-all-binary-codes-of-size-k) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
+| 1457 | [二叉树中的伪回文路径](../../problems/pseudo-palindromic-paths-in-a-binary-tree) | [[位运算](../bit-manipulation/README.md)] [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
+| 1442 | [形成两个异或相等数组的三元组数目](../../problems/count-triplets-that-can-form-two-arrays-of-equal-xor) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium |
+| 1434 | [每个人戴不同帽子的方案数](../../problems/number-of-ways-to-wear-different-hats-to-each-other) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 1404 | [将二进制表示减到 1 的步骤数](../../problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
+| 1356 | [根据数字二进制下 1 的数目排序](../../problems/sort-integers-by-the-number-of-1-bits) | [[排序](../sort/README.md)] [[位运算](../bit-manipulation/README.md)] | Easy |
+| 1342 | [将数字变成 0 的操作次数](../../problems/number-of-steps-to-reduce-a-number-to-zero) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 1318 | [或运算的最小翻转次数](../../problems/minimum-flips-to-make-a-or-b-equal-to-c) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 1310 | [子数组异或查询](../../problems/xor-queries-of-a-subarray) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 1297 | [子串的最大出现次数](../../problems/maximum-number-of-occurrences-of-a-substring) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
+| 1290 | [二进制链表转整数](../../problems/convert-binary-number-in-a-linked-list-to-integer) | [[位运算](../bit-manipulation/README.md)] [[链表](../linked-list/README.md)] | Easy |
+| 1256 | [加密数字](../../problems/encode-number) 🔒 | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium |
+| 1255 | [得分最高的单词集合](../../problems/maximum-score-words-formed-by-letters) | [[位运算](../bit-manipulation/README.md)] | Hard |
+| 1239 | [串联字符串的最大长度](../../problems/maximum-length-of-a-concatenated-string-with-unique-characters) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
+| 1178 | [猜字谜](../../problems/number-of-valid-words-for-each-puzzle) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Hard |
+| 1131 | [绝对值表达式的最大值](../../problems/maximum-of-absolute-value-expression) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium |
+| 1125 | [最小的必要团队](../../problems/smallest-sufficient-team) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 898 | [子数组按位或操作](../../problems/bitwise-ors-of-subarrays) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
+| 784 | [字母大小写全排列](../../problems/letter-case-permutation) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
+| 762 | [二进制表示中质数个计算置位](../../problems/prime-number-of-set-bits-in-binary-representation) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 756 | [金字塔转换矩阵](../../problems/pyramid-transition-matrix) | [[位运算](../bit-manipulation/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
+| 751 | [IP 到 CIDR](../../problems/ip-to-cidr) 🔒 | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 693 | [交替位二进制数](../../problems/binary-number-with-alternating-bits) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 477 | [汉明距离总和](../../problems/total-hamming-distance) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 476 | [数字的补数](../../problems/number-complement) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 461 | [汉明距离](../../problems/hamming-distance) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 421 | [数组中两个数的最大异或值](../../problems/maximum-xor-of-two-numbers-in-an-array) | [[位运算](../bit-manipulation/README.md)] [[字典树](../trie/README.md)] | Medium |
+| 411 | [最短特异单词缩写](../../problems/minimum-unique-word-abbreviation) 🔒 | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
+| 405 | [数字转换为十六进制数](../../problems/convert-a-number-to-hexadecimal) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 401 | [二进制手表](../../problems/binary-watch) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Easy |
+| 397 | [整数替换](../../problems/integer-replacement) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium |
+| 393 | [UTF-8 编码验证](../../problems/utf-8-validation) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 389 | [找不同](../../problems/find-the-difference) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Easy |
+| 371 | [两整数之和](../../problems/sum-of-two-integers) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 342 | [4的幂](../../problems/power-of-four) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 338 | [比特位计数](../../problems/counting-bits) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
+| 320 | [列举单词的全部缩写](../../problems/generalized-abbreviation) 🔒 | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
+| 318 | [最大单词长度乘积](../../problems/maximum-product-of-word-lengths) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 268 | [丢失的数字](../../problems/missing-number) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy |
+| 260 | [只出现一次的数字 III](../../problems/single-number-iii) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 231 | [2的幂](../../problems/power-of-two) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Easy |
+| 201 | [数字范围按位与](../../problems/bitwise-and-of-numbers-range) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 191 | [位1的个数](../../problems/number-of-1-bits) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 190 | [颠倒二进制位](../../problems/reverse-bits) | [[位运算](../bit-manipulation/README.md)] | Easy |
+| 187 | [重复的DNA序列](../../problems/repeated-dna-sequences) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
+| 169 | [多数元素](../../problems/majority-element) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Easy |
+| 137 | [只出现一次的数字 II](../../problems/single-number-ii) | [[位运算](../bit-manipulation/README.md)] | Medium |
+| 136 | [只出现一次的数字](../../problems/single-number) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Easy |
+| 78 | [子集](../../problems/subsets) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
diff --git a/tag/breadth-first-search/README.md b/tag/breadth-first-search/README.md
index a4976f342..0bfc32364 100644
--- a/tag/breadth-first-search/README.md
+++ b/tag/breadth-first-search/README.md
@@ -36,7 +36,7 @@
| 1036 | [逃离大迷宫](../../problems/escape-a-large-maze) | [[广度优先搜索](../breadth-first-search/README.md)] | Hard |
| 994 | [腐烂的橘子](../../problems/rotting-oranges) | [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 993 | [二叉树的堂兄弟节点](../../problems/cousins-in-binary-tree) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
-| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 934 | [最短的桥](../../problems/shortest-bridge) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 913 | [猫和老鼠](../../problems/cat-and-mouse) | [[广度优先搜索](../breadth-first-search/README.md)] [[极小化极大](../minimax/README.md)] | Hard |
| 909 | [蛇梯棋](../../problems/snakes-and-ladders) | [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
@@ -78,11 +78,11 @@
| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 133 | [克隆图](../../problems/clone-graph) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
| 130 | [被围绕的区域](../../problems/surrounded-regions) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 127 | [单词接龙](../../problems/word-ladder) | [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 127 | [单词接龙](../../problems/word-ladder) | [[广度优先搜索](../breadth-first-search/README.md)] | Hard |
| 126 | [单词接龙 II](../../problems/word-ladder-ii) | [[广度优先搜索](../breadth-first-search/README.md)] [[数组](../array/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
| 116 | [填充每个节点的下一个右侧节点指针](../../problems/populating-next-right-pointers-in-each-node) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 111 | [二叉树的最小深度](../../problems/minimum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
-| 107 | [二叉树的层次遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
-| 103 | [二叉树的锯齿形层次遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 107 | [二叉树的层序遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
+| 103 | [二叉树的锯齿形层序遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 102 | [二叉树的层序遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 101 | [对称二叉树](../../problems/symmetric-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
diff --git a/tag/depth-first-search/README.md b/tag/depth-first-search/README.md
index e486dbba9..d7abc14a2 100644
--- a/tag/depth-first-search/README.md
+++ b/tag/depth-first-search/README.md
@@ -55,7 +55,7 @@
| 979 | [在二叉树中分配硬币](../../problems/distribute-coins-in-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 971 | [翻转二叉树以匹配先序遍历](../../problems/flip-binary-tree-to-match-preorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 968 | [监控二叉树](../../problems/binary-tree-cameras) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 959 | [由斜杠划分区域](../../problems/regions-cut-by-slashes) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
| 947 | [移除最多的同行或同列石头](../../problems/most-stones-removed-with-same-row-or-column) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
| 938 | [二叉搜索树的范围和](../../problems/range-sum-of-bst) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
@@ -135,14 +135,14 @@
| 131 | [分割回文串](../../problems/palindrome-partitioning) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 130 | [被围绕的区域](../../problems/surrounded-regions) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
| 129 | [求根到叶子节点数字之和](../../problems/sum-root-to-leaf-numbers) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
-| 124 | [二叉树中的最大路径和](../../problems/binary-tree-maximum-path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard |
+| 124 | [二叉树中的最大路径和](../../problems/binary-tree-maximum-path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Hard |
| 117 | [填充每个节点的下一个右侧节点指针 II](../../problems/populating-next-right-pointers-in-each-node-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 116 | [填充每个节点的下一个右侧节点指针](../../problems/populating-next-right-pointers-in-each-node) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 114 | [二叉树展开为链表](../../problems/flatten-binary-tree-to-linked-list) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 113 | [路径总和 II](../../problems/path-sum-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 112 | [路径总和](../../problems/path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
| 111 | [二叉树的最小深度](../../problems/minimum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
-| 110 | [平衡二叉树](../../problems/balanced-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
+| 110 | [平衡二叉树](../../problems/balanced-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 109 | [有序链表转换二叉搜索树](../../problems/convert-sorted-list-to-binary-search-tree) | [[深度优先搜索](../depth-first-search/README.md)] [[链表](../linked-list/README.md)] | Medium |
| 108 | [将有序数组转换为二叉搜索树](../../problems/convert-sorted-array-to-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
| 106 | [从中序与后序遍历序列构造二叉树](../../problems/construct-binary-tree-from-inorder-and-postorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium |
diff --git a/tag/divide-and-conquer/README.md b/tag/divide-and-conquer/README.md
index 0d334b142..9fcc476e7 100644
--- a/tag/divide-and-conquer/README.md
+++ b/tag/divide-and-conquer/README.md
@@ -9,3 +9,23 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1274 | [矩形内船只的数目](../../problems/number-of-ships-in-a-rectangle) 🔒 | [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 973 | [最接近原点的 K 个点](../../problems/k-closest-points-to-origin) | [[堆](../heap/README.md)] [[排序](../sort/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 932 | [漂亮数组](../../problems/beautiful-array) | [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 903 | [DI 序列的有效排列](../../problems/valid-permutations-for-di-sequence) | [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 514 | [自由之路](../../problems/freedom-trail) | [[深度优先搜索](../depth-first-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 493 | [翻转对](../../problems/reverse-pairs) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 426 | [将二叉搜索树转化为排序的双向链表](../../problems/convert-binary-search-tree-to-sorted-doubly-linked-list) 🔒 | [[树](../tree/README.md)] [[链表](../linked-list/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 395 | [至少有K个重复字符的最长子串](../../problems/longest-substring-with-at-least-k-repeating-characters) | [[递归](../recursion/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
+| 327 | [区间和的个数](../../problems/count-of-range-sum) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 315 | [计算右侧小于当前元素的个数](../../problems/count-of-smaller-numbers-after-self) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 312 | [戳气球](../../problems/burst-balloons) | [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 282 | [给表达式添加运算符](../../problems/expression-add-operators) | [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 241 | [为运算表达式设计优先级](../../problems/different-ways-to-add-parentheses) | [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 240 | [搜索二维矩阵 II](../../problems/search-a-2d-matrix-ii) | [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 218 | [天际线问题](../../problems/the-skyline-problem) | [[堆](../heap/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[Line Sweep](../line-sweep/README.md)] | Hard |
+| 215 | [数组中的第K个最大元素](../../problems/kth-largest-element-in-an-array) | [[堆](../heap/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 169 | [多数元素](../../problems/majority-element) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Easy |
+| 53 | [最大子序和](../../problems/maximum-subarray) | [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
+| 23 | [合并K个升序链表](../../problems/merge-k-sorted-lists) | [[堆](../heap/README.md)] [[链表](../linked-list/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 4 | [寻找两个正序数组的中位数](../../problems/median-of-two-sorted-arrays) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
diff --git a/tag/dynamic-programming/README.md b/tag/dynamic-programming/README.md
index 58277ef32..882b2c7e5 100644
--- a/tag/dynamic-programming/README.md
+++ b/tag/dynamic-programming/README.md
@@ -9,242 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 1691 | [堆叠长方体的最大高度](../../problems/maximum-height-by-stacking-cuboids) | [[排序](../sort/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1690 | [石子游戏 VII](../../problems/stone-game-vii) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1687 | [从仓库到码头运输箱子](../../problems/delivering-boxes-from-storage-to-ports) | [[线段树](../segment-tree/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1682 | [Longest Palindromic Subsequence II](../../problems/longest-palindromic-subsequence-ii) 🔒 | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1671 | [得到山形数组的最少删除次数](../../problems/minimum-number-of-removals-to-make-mountain-array) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1664 | [生成平衡数组的方案数](../../problems/ways-to-make-a-fair-array) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1659 | [最大化网格幸福感](../../problems/maximize-grid-happiness) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 1655 | [分配重复整数](../../problems/distribute-repeating-integers) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 1654 | [到家的最少跳跃次数](../../problems/minimum-jumps-to-reach-home) | [[广度优先搜索](../breadth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1643 | [第 K 条最小指令](../../problems/kth-smallest-instructions) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1641 | [统计字典序元音字符串的数目](../../problems/count-sorted-vowel-strings) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 1639 | [通过给定词典构造目标字符串的方案数](../../problems/number-of-ways-to-form-a-target-string-given-a-dictionary) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1626 | [无矛盾的最佳球队](../../problems/best-team-with-no-conflicts) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1621 | [大小为 K 的不重叠线段的数目](../../problems/number-of-sets-of-k-non-overlapping-line-segments) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1611 | [使整数变为 0 的最少操作次数](../../problems/minimum-one-bit-operations-to-make-integers-zero) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1601 | [最多可达成的换楼请求数目](../../problems/maximum-number-of-achievable-transfer-requests) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1595 | [连通两组点的最小成本](../../problems/minimum-cost-to-connect-two-groups-of-points) | [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1594 | [矩阵的最大非负积](../../problems/maximum-non-negative-product-in-a-matrix) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1575 | [统计所有可行路径](../../problems/count-all-possible-routes) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1569 | [将子数组重新排序得到同一个二叉查找树的方案数](../../problems/number-of-ways-to-reorder-array-to-get-same-bst) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1563 | [石子游戏 V](../../problems/stone-game-v) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1553 | [吃掉 N 个橘子的最少天数](../../problems/minimum-number-of-days-to-eat-n-oranges) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1548 | [图中最相似的路径](../../problems/the-most-similar-path-in-a-graph) 🔒 | [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1547 | [切棍子的最小成本](../../problems/minimum-cost-to-cut-a-stick) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1546 | [和为目标值的最大数目不重叠非空子数组数目](../../problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1537 | [最大得分](../../problems/get-the-maximum-score) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1531 | [压缩字符串 II](../../problems/string-compression-ii) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1510 | [石子游戏 IV](../../problems/stone-game-iv) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1504 | [统计全 1 子矩形](../../problems/count-submatrices-with-all-ones) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1483 | [树节点的第 K 个祖先](../../problems/kth-ancestor-of-a-tree-node) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1478 | [安排邮筒](../../problems/allocate-mailboxes) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1477 | [找两个和为目标值且不重叠的子数组](../../problems/find-two-non-overlapping-sub-arrays-each-with-target-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1473 | [给房子涂色 III](../../problems/paint-house-iii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1463 | [摘樱桃 II](../../problems/cherry-pickup-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1458 | [两个子序列的最大点积](../../problems/max-dot-product-of-two-subsequences) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1449 | [数位成本和为目标值的最大数字](../../problems/form-largest-integer-with-digits-that-add-up-to-target) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1444 | [切披萨的方案数](../../problems/number-of-ways-of-cutting-a-pizza) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1434 | [每个人戴不同帽子的方案数](../../problems/number-of-ways-to-wear-different-hats-to-each-other) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1425 | [带限制的子序列和](../../problems/constrained-subsequence-sum) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1423 | [可获得的最大点数](../../problems/maximum-points-you-can-obtain-from-cards) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 1420 | [生成数组](../../problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1416 | [恢复数组](../../problems/restore-the-array) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1411 | [给 N x 3 网格图涂色的方案数](../../problems/number-of-ways-to-paint-n-x-3-grid) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1406 | [石子游戏 III](../../problems/stone-game-iii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1405 | [最长快乐字符串](../../problems/longest-happy-string) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1402 | [做菜顺序](../../problems/reducing-dishes) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1397 | [找到所有好字符串](../../problems/find-all-good-strings) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1388 | [3n 块披萨](../../problems/pizza-with-3n-slices) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1373 | [二叉搜索子树的最大键值和](../../problems/maximum-sum-bst-in-binary-tree) | [[二叉搜索树](../binary-search-tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1372 | [二叉树中的最长交错路径](../../problems/longest-zigzag-path-in-a-binary-tree) | [[树](../tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1367 | [二叉树中的列表](../../problems/linked-list-in-binary-tree) | [[树](../tree/README.md)] [[链表](../linked-list/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1363 | [形成三的最大倍数](../../problems/largest-multiple-of-three) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1359 | [有效的快递序列数目](../../problems/count-all-valid-pickup-and-delivery-options) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1349 | [参加考试的最大学生数](../../problems/maximum-students-taking-exam) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1340 | [跳跃游戏 V](../../problems/jump-game-v) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1339 | [分裂二叉树的最大乘积](../../problems/maximum-product-of-splitted-binary-tree) | [[树](../tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1335 | [工作计划的最低难度](../../problems/minimum-difficulty-of-a-job-schedule) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1326 | [灌溉花园的最少水龙头数目](../../problems/minimum-number-of-taps-to-open-to-water-a-garden) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1320 | [二指输入的的最小距离](../../problems/minimum-distance-to-type-a-word-using-two-fingers) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1314 | [矩阵区域和](../../problems/matrix-block-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1312 | [让字符串成为回文串的最少插入次数](../../problems/minimum-insertion-steps-to-make-a-string-palindrome) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1301 | [最大得分的路径数目](../../problems/number-of-paths-with-max-score) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1289 | [下降路径最小和 II](../../problems/minimum-falling-path-sum-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1278 | [分割回文串 III](../../problems/palindrome-partitioning-iii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1277 | [统计全为 1 的正方形子矩阵](../../problems/count-square-submatrices-with-all-ones) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1273 | [删除树节点](../../problems/delete-tree-nodes) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1269 | [停在原地的方案数](../../problems/number-of-ways-to-stay-in-the-same-place-after-some-steps) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1262 | [可被三整除的最大和](../../problems/greatest-sum-divisible-by-three) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1259 | [不相交的握手](../../problems/handshakes-that-dont-cross) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1246 | [删除回文子数组](../../problems/palindrome-removal) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1240 | [铺瓷砖](../../problems/tiling-a-rectangle-with-the-fewest-squares) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 1235 | [规划兼职工作](../../problems/maximum-profit-in-job-scheduling) | [[排序](../sort/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1230 | [抛掷硬币](../../problems/toss-strange-coins) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1227 | [飞机座位分配概率](../../problems/airplane-seat-assignment-probability) | [[脑筋急转弯](../brainteaser/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1223 | [掷骰子模拟](../../problems/dice-roll-simulation) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1220 | [统计元音字母序列的数目](../../problems/count-vowels-permutation) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1218 | [最长定差子序列](../../problems/longest-arithmetic-subsequence-of-given-difference) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1216 | [验证回文字符串 III](../../problems/valid-palindrome-iii) 🔒 | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1199 | [建造街区的最短时间](../../problems/minimum-time-to-build-blocks) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1191 | [K 次串联后最大子数组之和](../../problems/k-concatenation-maximum-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1187 | [使数组严格递增](../../problems/make-array-strictly-increasing) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1186 | [删除一次得到子数组最大和](../../problems/maximum-subarray-sum-with-one-deletion) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1155 | [掷骰子的N种方法](../../problems/number-of-dice-rolls-with-target-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1147 | [段式回文](../../problems/longest-chunked-palindrome-decomposition) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1143 | [最长公共子序列](../../problems/longest-common-subsequence) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1140 | [石子游戏 II](../../problems/stone-game-ii) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1139 | [最大的以 1 为边界的正方形](../../problems/largest-1-bordered-square) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1136 | [平行课程](../../problems/parallel-courses) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1130 | [叶值的最小代价生成树](../../problems/minimum-cost-tree-from-leaf-values) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1125 | [最小的必要团队](../../problems/smallest-sufficient-team) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1105 | [填充书架](../../problems/filling-bookcase-shelves) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1092 | [最短公共超序列](../../problems/shortest-common-supersequence) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1074 | [元素和为目标值的子矩阵数量](../../problems/number-of-submatrices-that-sum-to-target) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
-| 1067 | [范围内的数字计数](../../problems/digit-count-in-range) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1066 | [校园自行车分配 II](../../problems/campus-bikes-ii) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 1058 | [最小化舍入误差以满足目标](../../problems/minimize-rounding-error-to-meet-target) 🔒 | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1055 | [形成字符串的最短路径](../../problems/shortest-way-to-form-string) 🔒 | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1049 | [最后一块石头的重量 II](../../problems/last-stone-weight-ii) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1048 | [最长字符串链](../../problems/longest-string-chain) | [[哈希表](../hash-table/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1043 | [分隔数组以得到最大和](../../problems/partition-array-for-maximum-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1039 | [多边形三角剖分的最低得分](../../problems/minimum-score-triangulation-of-polygon) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1027 | [最长等差数列](../../problems/longest-arithmetic-subsequence) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1025 | [除数博弈](../../problems/divisor-game) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 1024 | [视频拼接](../../problems/video-stitching) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1012 | [至少有 1 位重复的数字](../../problems/numbers-with-repeated-digits) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1000 | [合并石头的最低成本](../../problems/minimum-cost-to-merge-stones) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 983 | [最低票价](../../problems/minimum-cost-for-tickets) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 982 | [按位与为零的三元组](../../problems/triples-with-bitwise-and-equal-to-zero) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 978 | [最长湍流子数组](../../problems/longest-turbulent-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 975 | [奇偶跳](../../problems/odd-even-jump) | [[栈](../stack/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard |
-| 968 | [监控二叉树](../../problems/binary-tree-cameras) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 964 | [表示数字的最少运算符](../../problems/least-operators-to-express-number) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 960 | [删列造序 III](../../problems/delete-columns-to-make-sorted-iii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 956 | [最高的广告牌](../../problems/tallest-billboard) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 943 | [最短超级串](../../problems/find-the-shortest-superstring) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 940 | [不同的子序列 II](../../problems/distinct-subsequences-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 935 | [骑士拨号器](../../problems/knight-dialer) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 931 | [下降路径最小和](../../problems/minimum-falling-path-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 920 | [播放列表的数量](../../problems/number-of-music-playlists) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 903 | [DI 序列的有效排列](../../problems/valid-permutations-for-di-sequence) | [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 902 | [最大为 N 的数字组合](../../problems/numbers-at-most-n-given-digit-set) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 898 | [子数组按位或操作](../../problems/bitwise-ors-of-subarrays) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 887 | [鸡蛋掉落](../../problems/super-egg-drop) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 879 | [盈利计划](../../problems/profitable-schemes) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 877 | [石子游戏](../../problems/stone-game) | [[极小化极大](../minimax/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 873 | [最长的斐波那契子序列的长度](../../problems/length-of-longest-fibonacci-subsequence) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 871 | [最低加油次数](../../problems/minimum-number-of-refueling-stops) | [[堆](../heap/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 847 | [访问所有节点的最短路径](../../problems/shortest-path-visiting-all-nodes) | [[广度优先搜索](../breadth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 838 | [推多米诺](../../problems/push-dominoes) | [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 837 | [新21点](../../problems/new-21-game) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 818 | [赛车](../../problems/race-car) | [[堆](../heap/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 813 | [最大平均值和的分组](../../problems/largest-sum-of-averages) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 808 | [分汤](../../problems/soup-servings) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 801 | [使序列递增的最小交换次数](../../problems/minimum-swaps-to-make-sequences-increasing) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 799 | [香槟塔](../../problems/champagne-tower) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 790 | [多米诺和托米诺平铺](../../problems/domino-and-tromino-tiling) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 787 | [K 站中转内最便宜的航班](../../problems/cheapest-flights-within-k-stops) | [[堆](../heap/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 764 | [最大加号标志](../../problems/largest-plus-sign) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 750 | [角矩形的数量](../../problems/number-of-corner-rectangles) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 746 | [使用最小花费爬楼梯](../../problems/min-cost-climbing-stairs) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 741 | [摘樱桃](../../problems/cherry-pickup) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 740 | [删除与获得点数](../../problems/delete-and-earn) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 730 | [统计不同回文子序列](../../problems/count-different-palindromic-subsequences) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 727 | [最小窗口子序列](../../problems/minimum-window-subsequence) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
-| 718 | [最长重复子数组](../../problems/maximum-length-of-repeated-subarray) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 714 | [买卖股票的最佳时机含手续费](../../problems/best-time-to-buy-and-sell-stock-with-transaction-fee) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 712 | [两个字符串的最小ASCII删除和](../../problems/minimum-ascii-delete-sum-for-two-strings) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 698 | [划分为k个相等的子集](../../problems/partition-to-k-equal-sum-subsets) | [[递归](../recursion/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 691 | [贴纸拼词](../../problems/stickers-to-spell-word) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 689 | [三个无重叠子数组的最大和](../../problems/maximum-sum-of-3-non-overlapping-subarrays) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 688 | [“马”在棋盘上的概率](../../problems/knight-probability-in-chessboard) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 673 | [最长递增子序列的个数](../../problems/number-of-longest-increasing-subsequence) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 664 | [奇怪的打印机](../../problems/strange-printer) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 656 | [金币路径](../../problems/coin-path) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 651 | [4键键盘](../../problems/4-keys-keyboard) 🔒 | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 650 | [只有两个键的键盘](../../problems/2-keys-keyboard) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 647 | [回文子串](../../problems/palindromic-substrings) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 646 | [最长数对链](../../problems/maximum-length-of-pair-chain) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 639 | [解码方法 2](../../problems/decode-ways-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 638 | [大礼包](../../problems/shopping-offers) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 629 | [K个逆序对数组](../../problems/k-inverse-pairs-array) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 600 | [不含连续1的非负整数](../../problems/non-negative-integers-without-consecutive-ones) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 576 | [出界的路径数](../../problems/out-of-boundary-paths) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 568 | [最大休假天数](../../problems/maximum-vacation-days) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 552 | [学生出勤记录 II](../../problems/student-attendance-record-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 546 | [移除盒子](../../problems/remove-boxes) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 523 | [连续的子数组和](../../problems/continuous-subarray-sum) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 517 | [超级洗衣机](../../problems/super-washing-machines) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 516 | [最长回文子序列](../../problems/longest-palindromic-subsequence) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 514 | [自由之路](../../problems/freedom-trail) | [[深度优先搜索](../depth-first-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 494 | [目标和](../../problems/target-sum) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 486 | [预测赢家](../../problems/predict-the-winner) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 474 | [一和零](../../problems/ones-and-zeroes) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 472 | [连接词](../../problems/concatenated-words) | [[深度优先搜索](../depth-first-search/README.md)] [[字典树](../trie/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 471 | [编码最短长度的字符串](../../problems/encode-string-with-shortest-length) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 467 | [环绕字符串中唯一的子字符串](../../problems/unique-substrings-in-wraparound-string) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 466 | [统计重复个数](../../problems/count-the-repetitions) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 464 | [我能赢吗](../../problems/can-i-win) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 446 | [等差数列划分 II - 子序列](../../problems/arithmetic-slices-ii-subsequence) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 418 | [屏幕可显示句子的数量](../../problems/sentence-screen-fitting) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 416 | [分割等和子集](../../problems/partition-equal-subset-sum) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 413 | [等差数列划分](../../problems/arithmetic-slices) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 410 | [分割数组的最大值](../../problems/split-array-largest-sum) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 403 | [青蛙过河](../../problems/frog-jump) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 392 | [判断子序列](../../problems/is-subsequence) | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 377 | [组合总和 Ⅳ](../../problems/combination-sum-iv) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 376 | [摆动序列](../../problems/wiggle-subsequence) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 375 | [猜数字大小 II](../../problems/guess-number-higher-or-lower-ii) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 368 | [最大整除子集](../../problems/largest-divisible-subset) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 363 | [矩形区域不超过 K 的最大数值和](../../problems/max-sum-of-rectangle-no-larger-than-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 361 | [轰炸敌人](../../problems/bomb-enemy) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 357 | [计算各个位数不同的数字个数](../../problems/count-numbers-with-unique-digits) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 354 | [俄罗斯套娃信封问题](../../problems/russian-doll-envelopes) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 351 | [安卓系统手势解锁](../../problems/android-unlock-patterns) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 343 | [整数拆分](../../problems/integer-break) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 338 | [比特位计数](../../problems/counting-bits) | [[位运算](../bit-manipulation/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 322 | [零钱兑换](../../problems/coin-change) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 321 | [拼接最大数](../../problems/create-maximum-number) | [[贪心算法](../greedy/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 312 | [戳气球](../../problems/burst-balloons) | [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 309 | [最佳买卖股票时机含冷冻期](../../problems/best-time-to-buy-and-sell-stock-with-cooldown) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 304 | [二维区域和检索 - 矩阵不可变](../../problems/range-sum-query-2d-immutable) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 303 | [区域和检索 - 数组不可变](../../problems/range-sum-query-immutable) | [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 300 | [最长上升子序列](../../problems/longest-increasing-subsequence) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 279 | [完全平方数](../../problems/perfect-squares) | [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 276 | [栅栏涂色](../../problems/paint-fence) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 265 | [粉刷房子 II](../../problems/paint-house-ii) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 264 | [丑数 II](../../problems/ugly-number-ii) | [[堆](../heap/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 256 | [粉刷房子](../../problems/paint-house) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 221 | [最大正方形](../../problems/maximal-square) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 213 | [打家劫舍 II](../../problems/house-robber-ii) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 198 | [打家劫舍](../../problems/house-robber) | [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 188 | [买卖股票的最佳时机 IV](../../problems/best-time-to-buy-and-sell-stock-iv) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 174 | [地下城游戏](../../problems/dungeon-game) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 152 | [乘积最大子数组](../../problems/maximum-product-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 140 | [单词拆分 II](../../problems/word-break-ii) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 139 | [单词拆分](../../problems/word-break) | [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 132 | [分割回文串 II](../../problems/palindrome-partitioning-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 131 | [分割回文串](../../problems/palindrome-partitioning) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 123 | [买卖股票的最佳时机 III](../../problems/best-time-to-buy-and-sell-stock-iii) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 121 | [买卖股票的最佳时机](../../problems/best-time-to-buy-and-sell-stock) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 120 | [三角形最小路径和](../../problems/triangle) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 115 | [不同的子序列](../../problems/distinct-subsequences) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 97 | [交错字符串](../../problems/interleaving-string) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 96 | [不同的二叉搜索树](../../problems/unique-binary-search-trees) | [[树](../tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 95 | [不同的二叉搜索树 II](../../problems/unique-binary-search-trees-ii) | [[树](../tree/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 91 | [解码方法](../../problems/decode-ways) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 87 | [扰乱字符串](../../problems/scramble-string) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 85 | [最大矩形](../../problems/maximal-rectangle) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 72 | [编辑距离](../../problems/edit-distance) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 70 | [爬楼梯](../../problems/climbing-stairs) | [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 64 | [最小路径和](../../problems/minimum-path-sum) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 63 | [不同路径 II](../../problems/unique-paths-ii) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 62 | [不同路径](../../problems/unique-paths) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 53 | [最大子序和](../../problems/maximum-subarray) | [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy |
-| 44 | [通配符匹配](../../problems/wildcard-matching) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 32 | [最长有效括号](../../problems/longest-valid-parentheses) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 10 | [正则表达式匹配](../../problems/regular-expression-matching) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 5 | [最长回文子串](../../problems/longest-palindromic-substring) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1 | [01 背包问题](../../problems/07MoiZ) | [[动态规划](../dynamic-programming/README.md)] | Easy |
diff --git a/tag/geometry/README.md b/tag/geometry/README.md
index 085448301..5a8521ed2 100644
--- a/tag/geometry/README.md
+++ b/tag/geometry/README.md
@@ -9,12 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 1610 | [可见点的最大数目](../../problems/maximum-number-of-visible-points) | [[几何](../geometry/README.md)] [[双指针](../two-pointers/README.md)] | Hard |
-| 1515 | [服务中心的最佳位置](../../problems/best-position-for-a-service-centre) | [[几何](../geometry/README.md)] | Hard |
-| 1453 | [圆形靶内的最大飞镖数量](../../problems/maximum-number-of-darts-inside-of-a-circular-dartboard) | [[几何](../geometry/README.md)] | Hard |
-| 1401 | [圆和矩形是否有重叠](../../problems/circle-and-rectangle-overlapping) | [[几何](../geometry/README.md)] | Medium |
-| 1266 | [访问所有点的最小时间](../../problems/minimum-time-visiting-all-points) | [[几何](../geometry/README.md)] [[数组](../array/README.md)] | Easy |
-| 1232 | [缀点成线](../../problems/check-if-it-is-a-straight-line) | [[几何](../geometry/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy |
-| 963 | [最小面积矩形 II](../../problems/minimum-area-rectangle-ii) | [[几何](../geometry/README.md)] [[数学](../math/README.md)] | Medium |
-| 892 | [三维形体的表面积](../../problems/surface-area-of-3d-shapes) | [[几何](../geometry/README.md)] [[数学](../math/README.md)] | Easy |
-| 587 | [安装栅栏](../../problems/erect-the-fence) | [[几何](../geometry/README.md)] | Hard |
diff --git a/tag/graph/README.md b/tag/graph/README.md
index 1e8098532..0d01c1b08 100644
--- a/tag/graph/README.md
+++ b/tag/graph/README.md
@@ -9,3 +9,51 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1631 | [最小体力消耗路径](../../problems/path-with-minimum-effort) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
+| 1615 | [最大网络秩](../../problems/maximal-network-rank) | [[图](../graph/README.md)] | Medium |
+| 1595 | [连通两组点的最小成本](../../problems/minimum-cost-to-connect-two-groups-of-points) | [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 1557 | [可以到达所有点的最少点数目](../../problems/minimum-number-of-vertices-to-reach-all-nodes) | [[图](../graph/README.md)] | Medium |
+| 1548 | [图中最相似的路径](../../problems/the-most-similar-path-in-a-graph) 🔒 | [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 1514 | [概率最大的路径](../../problems/path-with-maximum-probability) | [[图](../graph/README.md)] | Medium |
+| 1494 | [并行课程 II](../../problems/parallel-courses-ii) | [[图](../graph/README.md)] | Hard |
+| 1462 | [课程安排 IV](../../problems/course-schedule-iv) | [[图](../graph/README.md)] | Medium |
+| 1387 | [将整数按权重排序](../../problems/sort-integers-by-the-power-value) | [[排序](../sort/README.md)] [[图](../graph/README.md)] | Medium |
+| 1361 | [验证二叉树](../../problems/validate-binary-tree-nodes) | [[图](../graph/README.md)] | Medium |
+| 1334 | [阈值距离内邻居最少的城市](../../problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance) | [[图](../graph/README.md)] | Medium |
+| 1267 | [统计参与通信的服务器](../../problems/count-servers-that-communicate) | [[图](../graph/README.md)] [[数组](../array/README.md)] | Medium |
+| 1203 | [项目管理](../../problems/sort-items-by-groups-respecting-dependencies) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Hard |
+| 1168 | [水资源分配优化](../../problems/optimize-water-distribution-in-a-village) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
+| 1162 | [地图分析](../../problems/as-far-from-land-as-possible) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 1153 | [字符串转化](../../problems/string-transforms-into-another-string) 🔒 | [[图](../graph/README.md)] | Hard |
+| 1136 | [平行课程](../../problems/parallel-courses) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
+| 1135 | [最低成本联通所有城市](../../problems/connecting-cities-with-minimum-cost) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 1129 | [颜色交替的最短路径](../../problems/shortest-path-with-alternating-colors) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 1102 | [得分最高的路径](../../problems/path-with-maximum-minimum-value) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 1059 | [从始点到终点的所有路径](../../problems/all-paths-from-source-lead-to-destination) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 1042 | [不邻接植花](../../problems/flower-planting-with-no-adjacent) | [[图](../graph/README.md)] | Medium |
+| 997 | [找到小镇的法官](../../problems/find-the-town-judge) | [[图](../graph/README.md)] | Easy |
+| 996 | [正方形数组的数目](../../problems/number-of-squareful-arrays) | [[图](../graph/README.md)] [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
+| 990 | [等式方程的可满足性](../../problems/satisfiability-of-equality-equations) | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 959 | [由斜杠划分区域](../../problems/regions-cut-by-slashes) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 928 | [尽量减少恶意软件的传播 II](../../problems/minimize-malware-spread-ii) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
+| 886 | [可能的二分法](../../problems/possible-bipartition) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 854 | [相似度为 K 的字符串](../../problems/k-similar-strings) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Hard |
+| 841 | [钥匙和房间](../../problems/keys-and-rooms) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 839 | [相似字符串组](../../problems/similar-string-groups) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
+| 802 | [找到最终的安全状态](../../problems/find-eventual-safe-states) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 797 | [所有可能的路径](../../problems/all-paths-from-source-to-target) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
+| 785 | [判断二分图](../../problems/is-graph-bipartite) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 765 | [情侣牵手](../../problems/couples-holding-hands) | [[贪心算法](../greedy/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
+| 743 | [网络延迟时间](../../problems/network-delay-time) | [[堆](../heap/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 685 | [冗余连接 II](../../problems/redundant-connection-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
+| 684 | [冗余连接](../../problems/redundant-connection) | [[树](../tree/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 444 | [序列重建](../../problems/sequence-reconstruction) 🔒 | [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Medium |
+| 399 | [除法求值](../../problems/evaluate-division) | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 332 | [重新安排行程](../../problems/reconstruct-itinerary) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 323 | [无向图中连通分量的数目](../../problems/number-of-connected-components-in-an-undirected-graph) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 310 | [最小高度树](../../problems/minimum-height-trees) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
+| 269 | [火星词典](../../problems/alien-dictionary) 🔒 | [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Hard |
+| 261 | [以图判树](../../problems/graph-valid-tree) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
+| 210 | [课程表 II](../../problems/course-schedule-ii) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Medium |
+| 207 | [课程表](../../problems/course-schedule) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Medium |
+| 133 | [克隆图](../../problems/clone-graph) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium |
diff --git a/tag/greedy/README.md b/tag/greedy/README.md
index c8e90abd2..e76cdd027 100644
--- a/tag/greedy/README.md
+++ b/tag/greedy/README.md
@@ -9,6 +9,8 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1705 | [吃苹果的最大数目](../../problems/maximum-number-of-eaten-apples) | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] | Medium |
+| 1702 | [修改后的最大二进制字符串](../../problems/maximum-binary-string-after-change) | [[贪心算法](../greedy/README.md)] | Medium |
| 1689 | [十-二进制数的最少数目](../../problems/partitioning-into-minimum-number-of-deci-binary-numbers) | [[贪心算法](../greedy/README.md)] | Medium |
| 1686 | [石子游戏 VI](../../problems/stone-game-vi) | [[贪心算法](../greedy/README.md)] | Medium |
| 1685 | [有序数组中差绝对值之和](../../problems/sum-of-absolute-differences-in-a-sorted-array) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium |
diff --git a/tag/hash-table/README.md b/tag/hash-table/README.md
index 12e3dde8b..f54222616 100644
--- a/tag/hash-table/README.md
+++ b/tag/hash-table/README.md
@@ -109,7 +109,7 @@
| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
| 349 | [两个数组的交集](../../problems/intersection-of-two-arrays) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
| 347 | [前 K 个高频元素](../../problems/top-k-frequent-elements) | [[堆](../heap/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
-| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
+| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
| 336 | [回文对](../../problems/palindrome-pairs) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Hard |
| 325 | [和等于 k 的最长子数组长度](../../problems/maximum-size-subarray-sum-equals-k) 🔒 | [[哈希表](../hash-table/README.md)] | Medium |
| 311 | [稀疏矩阵的乘法](../../problems/sparse-matrix-multiplication) 🔒 | [[哈希表](../hash-table/README.md)] | Medium |
diff --git a/tag/heap/README.md b/tag/heap/README.md
index 3eb76f0d0..885e5e859 100644
--- a/tag/heap/README.md
+++ b/tag/heap/README.md
@@ -9,6 +9,7 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1705 | [吃苹果的最大数目](../../problems/maximum-number-of-eaten-apples) | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] | Medium |
| 1675 | [数组的最小偏移量](../../problems/minimize-deviation-in-array) | [[堆](../heap/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard |
| 1642 | [可以到达的最远建筑](../../problems/furthest-building-you-can-reach) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
| 1439 | [有序矩阵中的第 k 个最小数组和](../../problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows) | [[堆](../heap/README.md)] | Hard |
diff --git a/tag/line-sweep/README.md b/tag/line-sweep/README.md
index 592ea3e0f..06c012aa3 100644
--- a/tag/line-sweep/README.md
+++ b/tag/line-sweep/README.md
@@ -9,3 +9,9 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1288 | [删除被覆盖区间](../../problems/remove-covered-intervals) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium |
+| 1272 | [删除区间](../../problems/remove-interval) 🔒 | [[数学](../math/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium |
+| 1229 | [安排会议日程](../../problems/meeting-scheduler) 🔒 | [[Line Sweep](../line-sweep/README.md)] | Medium |
+| 850 | [矩形面积 II](../../problems/rectangle-area-ii) | [[线段树](../segment-tree/README.md)] [[Line Sweep](../line-sweep/README.md)] | Hard |
+| 391 | [完美矩形](../../problems/perfect-rectangle) | [[Line Sweep](../line-sweep/README.md)] | Hard |
+| 218 | [天际线问题](../../problems/the-skyline-problem) | [[堆](../heap/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[Line Sweep](../line-sweep/README.md)] | Hard |
diff --git a/tag/linked-list/README.md b/tag/linked-list/README.md
index 8642b2274..3f7f71b02 100644
--- a/tag/linked-list/README.md
+++ b/tag/linked-list/README.md
@@ -9,3 +9,45 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1670 | [设计前中后队列](../../problems/design-front-middle-back-queue) | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 1669 | [合并两个链表](../../problems/merge-in-between-linked-lists) | [[链表](../linked-list/README.md)] | Medium |
+| 1634 | [求两个多项式链表的和](../../problems/add-two-polynomials-represented-as-linked-lists) 🔒 | [[链表](../linked-list/README.md)] | Medium |
+| 1474 | [删除链表 M 个节点之后的 N 个节点](../../problems/delete-n-nodes-after-m-nodes-of-a-linked-list) 🔒 | [[链表](../linked-list/README.md)] | Easy |
+| 1367 | [二叉树中的列表](../../problems/linked-list-in-binary-tree) | [[树](../tree/README.md)] [[链表](../linked-list/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
+| 1290 | [二进制链表转整数](../../problems/convert-binary-number-in-a-linked-list-to-integer) | [[位运算](../bit-manipulation/README.md)] [[链表](../linked-list/README.md)] | Easy |
+| 1171 | [从链表中删去总和值为零的连续节点](../../problems/remove-zero-sum-consecutive-nodes-from-linked-list) | [[链表](../linked-list/README.md)] | Medium |
+| 1019 | [链表中的下一个更大节点](../../problems/next-greater-node-in-linked-list) | [[栈](../stack/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 876 | [链表的中间结点](../../problems/middle-of-the-linked-list) | [[链表](../linked-list/README.md)] | Easy |
+| 817 | [链表组件](../../problems/linked-list-components) | [[链表](../linked-list/README.md)] | Medium |
+| 725 | [分隔链表](../../problems/split-linked-list-in-parts) | [[链表](../linked-list/README.md)] | Medium |
+| 708 | [循环有序列表的插入](../../problems/insert-into-a-sorted-circular-linked-list) 🔒 | [[链表](../linked-list/README.md)] | Medium |
+| 707 | [设计链表](../../problems/design-linked-list) | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 445 | [两数相加 II](../../problems/add-two-numbers-ii) | [[链表](../linked-list/README.md)] | Medium |
+| 430 | [扁平化多级双向链表](../../problems/flatten-a-multilevel-doubly-linked-list) | [[深度优先搜索](../depth-first-search/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 426 | [将二叉搜索树转化为排序的双向链表](../../problems/convert-binary-search-tree-to-sorted-doubly-linked-list) 🔒 | [[树](../tree/README.md)] [[链表](../linked-list/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
+| 379 | [电话目录管理系统](../../problems/design-phone-directory) 🔒 | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 369 | [给单链表加一](../../problems/plus-one-linked-list) 🔒 | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 328 | [奇偶链表](../../problems/odd-even-linked-list) | [[链表](../linked-list/README.md)] | Medium |
+| 237 | [删除链表中的节点](../../problems/delete-node-in-a-linked-list) | [[链表](../linked-list/README.md)] | Easy |
+| 234 | [回文链表](../../problems/palindrome-linked-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Easy |
+| 206 | [反转链表](../../problems/reverse-linked-list) | [[链表](../linked-list/README.md)] | Easy |
+| 203 | [移除链表元素](../../problems/remove-linked-list-elements) | [[链表](../linked-list/README.md)] | Easy |
+| 160 | [相交链表](../../problems/intersection-of-two-linked-lists) | [[链表](../linked-list/README.md)] | Easy |
+| 148 | [排序链表](../../problems/sort-list) | [[排序](../sort/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 147 | [对链表进行插入排序](../../problems/insertion-sort-list) | [[排序](../sort/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 143 | [重排链表](../../problems/reorder-list) | [[链表](../linked-list/README.md)] | Medium |
+| 142 | [环形链表 II](../../problems/linked-list-cycle-ii) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
+| 141 | [环形链表](../../problems/linked-list-cycle) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Easy |
+| 138 | [复制带随机指针的链表](../../problems/copy-list-with-random-pointer) | [[哈希表](../hash-table/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 109 | [有序链表转换二叉搜索树](../../problems/convert-sorted-list-to-binary-search-tree) | [[深度优先搜索](../depth-first-search/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 92 | [反转链表 II](../../problems/reverse-linked-list-ii) | [[链表](../linked-list/README.md)] | Medium |
+| 86 | [分隔链表](../../problems/partition-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
+| 83 | [删除排序链表中的重复元素](../../problems/remove-duplicates-from-sorted-list) | [[链表](../linked-list/README.md)] | Easy |
+| 82 | [删除排序链表中的重复元素 II](../../problems/remove-duplicates-from-sorted-list-ii) | [[链表](../linked-list/README.md)] | Medium |
+| 61 | [旋转链表](../../problems/rotate-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
+| 25 | [K 个一组翻转链表](../../problems/reverse-nodes-in-k-group) | [[链表](../linked-list/README.md)] | Hard |
+| 24 | [两两交换链表中的节点](../../problems/swap-nodes-in-pairs) | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] | Medium |
+| 23 | [合并K个升序链表](../../problems/merge-k-sorted-lists) | [[堆](../heap/README.md)] [[链表](../linked-list/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
+| 21 | [合并两个有序链表](../../problems/merge-two-sorted-lists) | [[链表](../linked-list/README.md)] | Easy |
+| 19 | [删除链表的倒数第N个节点](../../problems/remove-nth-node-from-end-of-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
+| 2 | [两数相加](../../problems/add-two-numbers) | [[链表](../linked-list/README.md)] [[数学](../math/README.md)] | Medium |
diff --git a/tag/math/README.md b/tag/math/README.md
index 6483efac2..a2c1c456d 100644
--- a/tag/math/README.md
+++ b/tag/math/README.md
@@ -149,7 +149,7 @@
| 469 | [凸多边形](../../problems/convex-polygon) 🔒 | [[数学](../math/README.md)] | Medium |
| 462 | [最少移动次数使数组元素相等 II](../../problems/minimum-moves-to-equal-array-elements-ii) | [[数学](../math/README.md)] | Medium |
| 458 | [可怜的小猪](../../problems/poor-pigs) | [[数学](../math/README.md)] | Hard |
-| 453 | [最小移动次数使数组元素相等](../../problems/minimum-moves-to-equal-array-elements) | [[数学](../math/README.md)] | Easy |
+| 453 | [最小操作次数使数组元素相等](../../problems/minimum-moves-to-equal-array-elements) | [[数学](../math/README.md)] | Easy |
| 447 | [回旋镖的数量](../../problems/number-of-boomerangs) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium |
| 441 | [排列硬币](../../problems/arranging-coins) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
| 423 | [从英文中重建数字](../../problems/reconstruct-original-digits-from-english) | [[数学](../math/README.md)] | Medium |
diff --git a/tag/minimax/README.md b/tag/minimax/README.md
index 0cf0739a7..dd3b3951d 100644
--- a/tag/minimax/README.md
+++ b/tag/minimax/README.md
@@ -9,11 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 913 | [猫和老鼠](../../problems/cat-and-mouse) | [[广度优先搜索](../breadth-first-search/README.md)] [[极小化极大](../minimax/README.md)] | Hard |
-| 877 | [石子游戏](../../problems/stone-game) | [[极小化极大](../minimax/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 843 | [猜猜这个单词](../../problems/guess-the-word) | [[极小化极大](../minimax/README.md)] | Hard |
-| 486 | [预测赢家](../../problems/predict-the-winner) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 464 | [我能赢吗](../../problems/can-i-win) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 375 | [猜数字大小 II](../../problems/guess-number-higher-or-lower-ii) | [[极小化极大](../minimax/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 294 | [翻转游戏 II](../../problems/flip-game-ii) 🔒 | [[极小化极大](../minimax/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 292 | [Nim 游戏](../../problems/nim-game) | [[脑筋急转弯](../brainteaser/README.md)] [[极小化极大](../minimax/README.md)] | Easy |
diff --git a/tag/queue/README.md b/tag/queue/README.md
index 16db88027..8922feba8 100644
--- a/tag/queue/README.md
+++ b/tag/queue/README.md
@@ -9,12 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 933 | [最近的请求次数](../../problems/number-of-recent-calls) | [[队列](../queue/README.md)] | Easy |
-| 862 | [和至少为 K 的最短子数组](../../problems/shortest-subarray-with-sum-at-least-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] | Hard |
-| 641 | [设计循环双端队列](../../problems/design-circular-deque) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium |
-| 622 | [设计循环队列](../../problems/design-circular-queue) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium |
-| 621 | [任务调度器](../../problems/task-scheduler) | [[贪心算法](../greedy/README.md)] [[队列](../queue/README.md)] [[数组](../array/README.md)] | Medium |
-| 582 | [杀死进程](../../problems/kill-process) 🔒 | [[树](../tree/README.md)] [[队列](../queue/README.md)] | Medium |
-| 363 | [矩形区域不超过 K 的最大数值和](../../problems/max-sum-of-rectangle-no-larger-than-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 353 | [贪吃蛇](../../problems/design-snake-game) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium |
-| 346 | [数据流中的移动平均值](../../problems/moving-average-from-data-stream) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Easy |
diff --git a/tag/random/README.md b/tag/random/README.md
index 72a82d98f..25144cd0a 100644
--- a/tag/random/README.md
+++ b/tag/random/README.md
@@ -9,3 +9,9 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 710 | [黑名单中的随机数](../../problems/random-pick-with-blacklist) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Hard |
+| 528 | [按权重随机选择](../../problems/random-pick-with-weight) | [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Medium |
+| 519 | [随机翻转矩阵](../../problems/random-flip-matrix) | [[Random](../random/README.md)] | Medium |
+| 497 | [非重叠矩形中的随机点](../../problems/random-point-in-non-overlapping-rectangles) | [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Medium |
+| 478 | [在圆内随机生成点](../../problems/generate-random-point-in-a-circle) | [[数学](../math/README.md)] [[Random](../random/README.md)] [[Rejection Sampling](../rejection-sampling/README.md)] | Medium |
+| 470 | [用 Rand7() 实现 Rand10()](../../problems/implement-rand10-using-rand7) | [[Random](../random/README.md)] [[Rejection Sampling](../rejection-sampling/README.md)] | Medium |
diff --git a/tag/recursion/README.md b/tag/recursion/README.md
index f99d827a5..044d10bbf 100644
--- a/tag/recursion/README.md
+++ b/tag/recursion/README.md
@@ -11,6 +11,7 @@
| :-: | - | - | :-: |
| 1306 | [跳跃游戏 III](../../problems/jump-game-iii) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] | Medium |
| 1137 | [第 N 个泰波那契数](../../problems/n-th-tribonacci-number) | [[递归](../recursion/README.md)] | Easy |
+| 967 | [连续差相同的数字](../../problems/numbers-with-same-consecutive-differences) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
| 938 | [二叉搜索树的范围和](../../problems/range-sum-of-bst) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 897 | [递增顺序查找树](../../problems/increasing-order-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 894 | [所有可能的满二叉树](../../problems/all-possible-full-binary-trees) | [[树](../tree/README.md)] [[递归](../recursion/README.md)] | Medium |
@@ -30,6 +31,9 @@
| 369 | [给单链表加一](../../problems/plus-one-linked-list) 🔒 | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] | Medium |
| 248 | [中心对称数 III](../../problems/strobogrammatic-number-iii) 🔒 | [[递归](../recursion/README.md)] [[数学](../math/README.md)] | Hard |
| 247 | [中心对称数 II](../../problems/strobogrammatic-number-ii) 🔒 | [[递归](../recursion/README.md)] [[数学](../math/README.md)] | Medium |
+| 124 | [二叉树中的最大路径和](../../problems/binary-tree-maximum-path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Hard |
+| 110 | [平衡二叉树](../../problems/balanced-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 104 | [二叉树的最大深度](../../problems/maximum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 98 | [验证二叉搜索树](../../problems/validate-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Medium |
+| 24 | [两两交换链表中的节点](../../problems/swap-nodes-in-pairs) | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] | Medium |
| 17 | [电话号码的字母组合](../../problems/letter-combinations-of-a-phone-number) | [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
diff --git a/tag/reservoir-sampling/README.md b/tag/reservoir-sampling/README.md
index 7d9ca74cc..1fc516eb3 100644
--- a/tag/reservoir-sampling/README.md
+++ b/tag/reservoir-sampling/README.md
@@ -9,3 +9,5 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 398 | [随机数索引](../../problems/random-pick-index) | [[蓄水池抽样](../reservoir-sampling/README.md)] | Medium |
+| 382 | [链表随机节点](../../problems/linked-list-random-node) | [[蓄水池抽样](../reservoir-sampling/README.md)] | Medium |
diff --git a/tag/sliding-window/README.md b/tag/sliding-window/README.md
index d01d133ef..101291dc2 100644
--- a/tag/sliding-window/README.md
+++ b/tag/sliding-window/README.md
@@ -30,7 +30,7 @@
| 480 | [滑动窗口中位数](../../problems/sliding-window-median) | [[Sliding Window](../sliding-window/README.md)] | Hard |
| 424 | [替换后的最长重复字符](../../problems/longest-repeating-character-replacement) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
| 395 | [至少有K个重复字符的最长子串](../../problems/longest-substring-with-at-least-k-repeating-characters) | [[递归](../recursion/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
+| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
| 239 | [滑动窗口最大值](../../problems/sliding-window-maximum) | [[堆](../heap/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
| 159 | [至多包含两个不同字符的最长子串](../../problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
| 76 | [最小覆盖子串](../../problems/minimum-window-substring) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
diff --git a/tag/sort/README.md b/tag/sort/README.md
index 8532603a2..49e4c7112 100644
--- a/tag/sort/README.md
+++ b/tag/sort/README.md
@@ -9,74 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 1691 | [堆叠长方体的最大高度](../../problems/maximum-height-by-stacking-cuboids) | [[排序](../sort/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1648 | [销售价值减少的颜色球](../../problems/sell-diminishing-valued-colored-balls) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[数学](../math/README.md)] | Medium |
-| 1647 | [字符频次唯一的最小删除次数](../../problems/minimum-deletions-to-make-character-frequencies-unique) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium |
-| 1640 | [能否连接形成数组](../../problems/check-array-formation-through-concatenation) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 1637 | [两点之间不包含任何点的最宽垂直面积](../../problems/widest-vertical-area-between-two-points-containing-no-points) | [[排序](../sort/README.md)] | Medium |
-| 1636 | [按照频率将数组升序排序](../../problems/sort-array-by-increasing-frequency) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 1630 | [等差子数组](../../problems/arithmetic-subarrays) | [[排序](../sort/README.md)] | Medium |
-| 1561 | [你可以获得的最大硬币数目](../../problems/maximum-number-of-coins-you-can-get) | [[排序](../sort/README.md)] | Medium |
-| 1528 | [重新排列字符串](../../problems/shuffle-string) | [[排序](../sort/README.md)] | Easy |
-| 1509 | [三次操作后最大值与最小值的最小差](../../problems/minimum-difference-between-largest-and-smallest-value-in-three-moves) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1508 | [子数组和排序后的区间和](../../problems/range-sum-of-sorted-subarray-sums) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1502 | [判断能否形成等差数列](../../problems/can-make-arithmetic-progression-from-sequence) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 1498 | [满足条件的子序列数目](../../problems/number-of-subsequences-that-satisfy-the-given-sum-condition) | [[排序](../sort/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 1491 | [去掉最低工资和最高工资后的工资平均值](../../problems/average-salary-excluding-the-minimum-and-maximum-salary) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 1481 | [不同整数的最少数目](../../problems/least-number-of-unique-integers-after-k-removals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1471 | [数组中的 k 个最强值](../../problems/the-k-strongest-values-in-an-array) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1452 | [收藏清单](../../problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1451 | [重新排列句子中的单词](../../problems/rearrange-words-in-a-sentence) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1424 | [对角线遍历 II](../../problems/diagonal-traverse-ii) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1403 | [非递增顺序的最小子序列](../../problems/minimum-subsequence-in-non-increasing-order) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Easy |
-| 1387 | [将整数按权重排序](../../problems/sort-integers-by-the-power-value) | [[排序](../sort/README.md)] [[图](../graph/README.md)] | Medium |
-| 1383 | [最大的团队表现值](../../problems/maximum-performance-of-a-team) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Hard |
-| 1370 | [上升下降字符串](../../problems/increasing-decreasing-string) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1366 | [通过投票对团队排名](../../problems/rank-teams-by-votes) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1356 | [根据数字二进制下 1 的数目排序](../../problems/sort-integers-by-the-number-of-1-bits) | [[排序](../sort/README.md)] [[位运算](../bit-manipulation/README.md)] | Easy |
-| 1353 | [最多可以参加的会议数目](../../problems/maximum-number-of-events-that-can-be-attended) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[线段树](../segment-tree/README.md)] | Medium |
-| 1333 | [餐厅过滤器](../../problems/filter-restaurants-by-vegan-friendly-price-and-distance) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1329 | [将矩阵按对角线排序](../../problems/sort-the-matrix-diagonally) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 1305 | [两棵二叉搜索树中的所有元素](../../problems/all-elements-in-two-binary-search-trees) | [[排序](../sort/README.md)] [[树](../tree/README.md)] | Medium |
-| 1288 | [删除被覆盖区间](../../problems/remove-covered-intervals) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium |
-| 1244 | [力扣排行榜](../../problems/design-a-leaderboard) 🔒 | [[排序](../sort/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
-| 1235 | [规划兼职工作](../../problems/maximum-profit-in-job-scheduling) | [[排序](../sort/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1183 | [矩阵中 1 的最大数量](../../problems/maximum-number-of-ones) 🔒 | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Hard |
-| 1152 | [用户网站访问行为分析](../../problems/analyze-user-website-visit-pattern) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
-| 1122 | [数组的相对排序](../../problems/relative-sort-array) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 1099 | [小于 K 的两数之和](../../problems/two-sum-less-than-k) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy |
-| 1086 | [前五科的均分](../../problems/high-five) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy |
-| 1057 | [校园自行车分配](../../problems/campus-bikes) 🔒 | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium |
-| 1054 | [距离相等的条形码](../../problems/distant-barcodes) | [[堆](../heap/README.md)] [[排序](../sort/README.md)] | Medium |
-| 1030 | [距离顺序排列矩阵单元格](../../problems/matrix-cells-in-distance-order) | [[排序](../sort/README.md)] | Easy |
-| 976 | [三角形的最大周长](../../problems/largest-perimeter-triangle) | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Easy |
-| 973 | [最接近原点的 K 个点](../../problems/k-closest-points-to-origin) | [[堆](../heap/README.md)] [[排序](../sort/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium |
-| 969 | [煎饼排序](../../problems/pancake-sorting) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 948 | [令牌放置](../../problems/bag-of-tokens) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
-| 922 | [按奇偶排序数组 II](../../problems/sort-array-by-parity-ii) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy |
-| 853 | [车队](../../problems/car-fleet) | [[排序](../sort/README.md)] | Medium |
-| 767 | [重构字符串](../../problems/reorganize-string) | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 710 | [黑名单中的随机数](../../problems/random-pick-with-blacklist) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Hard |
-| 527 | [单词缩写](../../problems/word-abbreviation) 🔒 | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Hard |
-| 524 | [通过删除字母匹配到字典里最长单词](../../problems/longest-word-in-dictionary-through-deleting) | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
-| 493 | [翻转对](../../problems/reverse-pairs) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
-| 452 | [用最少数量的箭引爆气球](../../problems/minimum-number-of-arrows-to-burst-balloons) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium |
-| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
-| 349 | [两个数组的交集](../../problems/intersection-of-two-arrays) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
-| 327 | [区间和的个数](../../problems/count-of-range-sum) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
-| 324 | [摆动排序 II](../../problems/wiggle-sort-ii) | [[排序](../sort/README.md)] | Medium |
-| 315 | [计算右侧小于当前元素的个数](../../problems/count-of-smaller-numbers-after-self) | [[排序](../sort/README.md)] [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard |
-| 296 | [最佳的碰头地点](../../problems/best-meeting-point) 🔒 | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Hard |
-| 280 | [摆动排序](../../problems/wiggle-sort) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
-| 274 | [H 指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
-| 253 | [会议室 II](../../problems/meeting-rooms-ii) 🔒 | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium |
-| 252 | [会议室](../../problems/meeting-rooms) 🔒 | [[排序](../sort/README.md)] | Easy |
-| 242 | [有效的字母异位词](../../problems/valid-anagram) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Easy |
-| 220 | [存在重复元素 III](../../problems/contains-duplicate-iii) | [[排序](../sort/README.md)] [[Ordered Map](../ordered-map/README.md)] | Medium |
-| 179 | [最大数](../../problems/largest-number) | [[排序](../sort/README.md)] | Medium |
-| 164 | [最大间距](../../problems/maximum-gap) | [[排序](../sort/README.md)] | Hard |
-| 148 | [排序链表](../../problems/sort-list) | [[排序](../sort/README.md)] [[链表](../linked-list/README.md)] | Medium |
-| 147 | [对链表进行插入排序](../../problems/insertion-sort-list) | [[排序](../sort/README.md)] [[链表](../linked-list/README.md)] | Medium |
-| 75 | [颜色分类](../../problems/sort-colors) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
-| 57 | [插入区间](../../problems/insert-interval) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Hard |
-| 56 | [合并区间](../../problems/merge-intervals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium |
diff --git a/tag/stack/README.md b/tag/stack/README.md
index e3cdc14db..9aabcd33e 100644
--- a/tag/stack/README.md
+++ b/tag/stack/README.md
@@ -9,6 +9,7 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1703 | [得到连续 K 个 1 的最少相邻交换次数](../../problems/minimum-adjacent-swaps-for-k-consecutive-ones) | [[栈](../stack/README.md)] | Hard |
| 1673 | [找出最具竞争力的子序列](../../problems/find-the-most-competitive-subsequence) | [[栈](../stack/README.md)] [[贪心算法](../greedy/README.md)] | Medium |
| 1598 | [文件夹操作日志搜集器](../../problems/crawler-log-folder) | [[栈](../stack/README.md)] | Easy |
| 1544 | [整理字符串](../../problems/make-the-string-great) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Easy |
@@ -65,7 +66,7 @@
| 150 | [逆波兰表达式求值](../../problems/evaluate-reverse-polish-notation) | [[栈](../stack/README.md)] | Medium |
| 145 | [二叉树的后序遍历](../../problems/binary-tree-postorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] | Medium |
| 144 | [二叉树的前序遍历](../../problems/binary-tree-preorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] | Medium |
-| 103 | [二叉树的锯齿形层次遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 103 | [二叉树的锯齿形层序遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 94 | [二叉树的中序遍历](../../problems/binary-tree-inorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[哈希表](../hash-table/README.md)] | Medium |
| 85 | [最大矩形](../../problems/maximal-rectangle) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
| 84 | [柱状图中最大的矩形](../../problems/largest-rectangle-in-histogram) | [[栈](../stack/README.md)] [[数组](../array/README.md)] | Hard |
diff --git a/tag/string/README.md b/tag/string/README.md
index 47dcec77c..dabd214b3 100644
--- a/tag/string/README.md
+++ b/tag/string/README.md
@@ -9,213 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 1684 | [统计一致字符串的数目](../../problems/count-the-number-of-consistent-strings) | [[字符串](../string/README.md)] | Easy |
-| 1682 | [Longest Palindromic Subsequence II](../../problems/longest-palindromic-subsequence-ii) 🔒 | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 1678 | [设计 Goal 解析器](../../problems/goal-parser-interpretation) | [[字符串](../string/README.md)] | Easy |
-| 1668 | [最大重复子字符串](../../problems/maximum-repeating-substring) | [[字符串](../string/README.md)] | Easy |
-| 1662 | [检查两个字符串数组是否相等](../../problems/check-if-two-string-arrays-are-equivalent) | [[字符串](../string/README.md)] | Easy |
-| 1653 | [使字符串平衡的最少删除次数](../../problems/minimum-deletions-to-make-string-balanced) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1638 | [统计只差一个字符的子串数目](../../problems/count-substrings-that-differ-by-one-character) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1624 | [两个相同字符之间的最长子字符串](../../problems/largest-substring-between-two-equal-characters) | [[字符串](../string/README.md)] | Easy |
-| 1618 | [找出适应屏幕的最大字号](../../problems/maximum-font-to-fit-a-sentence-in-a-screen) 🔒 | [[字符串](../string/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
-| 1616 | [分割两个字符串得到回文串](../../problems/split-two-strings-to-make-palindrome) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1614 | [括号的最大嵌套深度](../../problems/maximum-nesting-depth-of-the-parentheses) | [[字符串](../string/README.md)] | Easy |
-| 1604 | [警告一小时内使用相同员工卡大于等于三次的人](../../problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period) | [[字符串](../string/README.md)] [[Ordered Map](../ordered-map/README.md)] | Medium |
-| 1597 | [根据中缀表达式构造二叉表达式树](../../problems/build-binary-expression-tree-from-infix-expression) 🔒 | [[树](../tree/README.md)] [[字符串](../string/README.md)] | Hard |
-| 1592 | [重新排列单词间的空格](../../problems/rearrange-spaces-between-words) | [[字符串](../string/README.md)] | Easy |
-| 1585 | [检查字符串是否可以通过排序子字符串得到另一个字符串](../../problems/check-if-string-is-transformable-with-substring-sort-operations) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Hard |
-| 1576 | [替换所有的问号](../../problems/replace-all-s-to-avoid-consecutive-repeating-characters) | [[字符串](../string/README.md)] | Easy |
-| 1573 | [分割字符串的方案数](../../problems/number-of-ways-to-split-a-string) | [[字符串](../string/README.md)] | Medium |
-| 1556 | [千位分隔数](../../problems/thousand-separator) | [[字符串](../string/README.md)] | Easy |
-| 1545 | [找出第 N 个二进制字符串中的第 K 位](../../problems/find-kth-bit-in-nth-binary-string) | [[字符串](../string/README.md)] | Medium |
-| 1544 | [整理字符串](../../problems/make-the-string-great) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1542 | [找出最长的超赞子字符串](../../problems/find-longest-awesome-substring) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Hard |
-| 1541 | [平衡括号字符串的最少插入次数](../../problems/minimum-insertions-to-balance-a-parentheses-string) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1540 | [K 次操作转变字符串](../../problems/can-convert-string-in-k-moves) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1531 | [压缩字符串 II](../../problems/string-compression-ii) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1529 | [灯泡开关 IV](../../problems/bulb-switcher-iv) | [[字符串](../string/README.md)] | Medium |
-| 1525 | [字符串的好分割数目](../../problems/number-of-good-ways-to-split-a-string) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1513 | [仅含 1 的子串数](../../problems/number-of-substrings-with-only-1s) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1507 | [转变日期格式](../../problems/reformat-date) | [[字符串](../string/README.md)] | Easy |
-| 1496 | [判断路径是否相交](../../problems/path-crossing) | [[字符串](../string/README.md)] | Easy |
-| 1487 | [保证文件名唯一](../../problems/making-file-names-unique) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1461 | [检查一个字符串是否包含所有长度为 K 的二进制子串](../../problems/check-if-a-string-contains-all-binary-codes-of-size-k) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1456 | [定长子串中元音的最大数目](../../problems/maximum-number-of-vowels-in-a-substring-of-given-length) | [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 1455 | [检查单词是否为句中其他单词的前缀](../../problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence) | [[字符串](../string/README.md)] | Easy |
-| 1452 | [收藏清单](../../problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1451 | [重新排列句子中的单词](../../problems/rearrange-words-in-a-sentence) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1449 | [数位成本和为目标值的最大数字](../../problems/form-largest-integer-with-digits-that-add-up-to-target) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1446 | [连续字符](../../problems/consecutive-characters) | [[字符串](../string/README.md)] | Easy |
-| 1436 | [旅行终点站](../../problems/destination-city) | [[字符串](../string/README.md)] | Easy |
-| 1433 | [检查一个字符串是否可以打破另一个字符串](../../problems/check-if-a-string-can-break-another-string) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1432 | [改变一个整数能得到的最大差值](../../problems/max-difference-you-can-get-from-changing-an-integer) | [[字符串](../string/README.md)] | Medium |
-| 1422 | [分割字符串的最大得分](../../problems/maximum-score-after-splitting-a-string) | [[字符串](../string/README.md)] | Easy |
-| 1419 | [数青蛙](../../problems/minimum-number-of-frogs-croaking) | [[字符串](../string/README.md)] | Medium |
-| 1417 | [重新格式化字符串](../../problems/reformat-the-string) | [[字符串](../string/README.md)] | Easy |
-| 1410 | [HTML 实体解析器](../../problems/html-entity-parser) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1408 | [数组中的字符串匹配](../../problems/string-matching-in-an-array) | [[字符串](../string/README.md)] | Easy |
-| 1404 | [将二进制表示减到 1 的步骤数](../../problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1392 | [最长快乐前缀](../../problems/longest-happy-prefix) | [[字符串](../string/README.md)] | Hard |
-| 1374 | [生成每种字符都是奇数个的字符串](../../problems/generate-a-string-with-characters-that-have-odd-counts) | [[字符串](../string/README.md)] | Easy |
-| 1371 | [每个元音包含偶数次的最长子字符串](../../problems/find-the-longest-substring-containing-vowels-in-even-counts) | [[字符串](../string/README.md)] | Medium |
-| 1370 | [上升下降字符串](../../problems/increasing-decreasing-string) | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1358 | [包含所有三种字符的子字符串数目](../../problems/number-of-substrings-containing-all-three-characters) | [[字符串](../string/README.md)] | Medium |
-| 1347 | [制造字母异位词的最小步骤数](../../problems/minimum-number-of-steps-to-make-two-strings-anagram) | [[字符串](../string/README.md)] | Medium |
-| 1332 | [删除回文子序列](../../problems/remove-palindromic-subsequences) | [[字符串](../string/README.md)] | Easy |
-| 1328 | [破坏回文串](../../problems/break-a-palindrome) | [[字符串](../string/README.md)] | Medium |
-| 1324 | [竖直打印单词](../../problems/print-words-vertically) | [[字符串](../string/README.md)] | Medium |
-| 1316 | [不同的循环子字符串](../../problems/distinct-echo-substrings) | [[字符串](../string/README.md)] | Hard |
-| 1311 | [获取你好友已观看的视频](../../problems/get-watched-videos-by-your-friends) | [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1309 | [解码字母到整数映射](../../problems/decrypt-string-from-alphabet-to-integer-mapping) | [[字符串](../string/README.md)] | Easy |
-| 1297 | [子串的最大出现次数](../../problems/maximum-number-of-occurrences-of-a-substring) | [[位运算](../bit-manipulation/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1271 | [十六进制魔术数字](../../problems/hexspeak) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1268 | [搜索推荐系统](../../problems/search-suggestions-system) | [[字符串](../string/README.md)] | Medium |
-| 1249 | [移除无效的括号](../../problems/minimum-remove-to-make-valid-parentheses) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1247 | [交换字符使得字符串相同](../../problems/minimum-swaps-to-make-strings-equal) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1234 | [替换子串得到平衡字符串](../../problems/replace-the-substring-for-balanced-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1233 | [删除子文件夹](../../problems/remove-sub-folders-from-the-filesystem) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1221 | [分割平衡字符串](../../problems/split-a-string-in-balanced-strings) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1216 | [验证回文字符串 III](../../problems/valid-palindrome-iii) 🔒 | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 1189 | [“气球” 的最大数量](../../problems/maximum-number-of-balloons) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1181 | [前后拼接](../../problems/before-and-after-puzzle) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 1180 | [统计只含单一字母的子串](../../problems/count-substrings-with-only-one-distinct-letter) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1177 | [构建回文串检测](../../problems/can-make-palindrome-from-substring) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1170 | [比较字符串最小字母出现频次](../../problems/compare-strings-by-frequency-of-the-smallest-character) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1169 | [查询无效交易](../../problems/invalid-transactions) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1165 | [单行键盘](../../problems/single-row-keyboard) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 1163 | [按字典序排在最后的子串](../../problems/last-substring-in-lexicographical-order) | [[字符串](../string/README.md)] | Hard |
-| 1156 | [单字符重复子串的最大长度](../../problems/swap-for-longest-repeated-character-substring) | [[字符串](../string/README.md)] | Medium |
-| 1138 | [字母板上的路径](../../problems/alphabet-board-path) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1119 | [删去字符串中的元音](../../problems/remove-vowels-from-a-string) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 1108 | [IP 地址无效化](../../problems/defanging-an-ip-address) | [[字符串](../string/README.md)] | Easy |
-| 1106 | [解析布尔表达式](../../problems/parsing-a-boolean-expression) | [[字符串](../string/README.md)] | Hard |
-| 1100 | [长度为 K 的无重复字符子串](../../problems/find-k-length-substrings-with-no-repeated-characters) 🔒 | [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 1096 | [花括号展开 II](../../problems/brace-expansion-ii) | [[字符串](../string/README.md)] | Hard |
-| 1081 | [不同字符的最小子序列](../../problems/smallest-subsequence-of-distinct-characters) | [[栈](../stack/README.md)] [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1071 | [字符串的最大公因子](../../problems/greatest-common-divisor-of-strings) | [[字符串](../string/README.md)] | Easy |
-| 1065 | [字符串的索引对](../../problems/index-pairs-of-a-string) 🔒 | [[字典树](../trie/README.md)] [[字符串](../string/README.md)] | Easy |
-| 1062 | [最长重复子串](../../problems/longest-repeating-substring) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 1023 | [驼峰式匹配](../../problems/camelcase-matching) | [[字典树](../trie/README.md)] [[字符串](../string/README.md)] | Medium |
-| 1016 | [子串能表示从 1 到 N 数字的二进制串](../../problems/binary-string-with-substrings-representing-1-to-n) | [[字符串](../string/README.md)] | Medium |
-| 1003 | [检查替换后的词是否有效](../../problems/check-if-word-is-valid-after-substitutions) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 966 | [元音拼写检查器](../../problems/vowel-spellchecker) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 937 | [重新排列日志文件](../../problems/reorder-data-in-log-files) | [[字符串](../string/README.md)] | Easy |
-| 936 | [戳印序列](../../problems/stamping-the-sequence) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Hard |
-| 929 | [独特的电子邮件地址](../../problems/unique-email-addresses) | [[字符串](../string/README.md)] | Easy |
-| 925 | [长按键入](../../problems/long-pressed-name) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
-| 917 | [仅仅反转字母](../../problems/reverse-only-letters) | [[字符串](../string/README.md)] | Easy |
-| 916 | [单词子集](../../problems/word-subsets) | [[字符串](../string/README.md)] | Medium |
-| 899 | [有序队列](../../problems/orderly-queue) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard |
-| 893 | [特殊等价字符串组](../../problems/groups-of-special-equivalent-strings) | [[字符串](../string/README.md)] | Easy |
-| 890 | [查找和替换模式](../../problems/find-and-replace-pattern) | [[字符串](../string/README.md)] | Medium |
-| 859 | [亲密字符串](../../problems/buddy-strings) | [[字符串](../string/README.md)] | Easy |
-| 856 | [括号的分数](../../problems/score-of-parentheses) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 848 | [字母移位](../../problems/shifting-letters) | [[字符串](../string/README.md)] | Medium |
-| 842 | [将数组拆分成斐波那契序列](../../problems/split-array-into-fibonacci-sequence) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 833 | [字符串中的查找与替换](../../problems/find-and-replace-in-string) | [[字符串](../string/README.md)] | Medium |
-| 831 | [隐藏个人信息](../../problems/masking-personal-information) | [[字符串](../string/README.md)] | Medium |
-| 824 | [山羊拉丁文](../../problems/goat-latin) | [[字符串](../string/README.md)] | Easy |
-| 819 | [最常见的单词](../../problems/most-common-word) | [[字符串](../string/README.md)] | Easy |
-| 816 | [模糊坐标](../../problems/ambiguous-coordinates) | [[字符串](../string/README.md)] | Medium |
-| 809 | [情感丰富的文字](../../problems/expressive-words) | [[字符串](../string/README.md)] | Medium |
-| 804 | [唯一摩尔斯密码词](../../problems/unique-morse-code-words) | [[字符串](../string/README.md)] | Easy |
-| 800 | [相似 RGB 颜色](../../problems/similar-rgb-color) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy |
-| 791 | [自定义字符串排序](../../problems/custom-sort-string) | [[字符串](../string/README.md)] | Medium |
-| 788 | [旋转数字](../../problems/rotated-digits) | [[字符串](../string/README.md)] | Easy |
-| 772 | [基本计算器 III](../../problems/basic-calculator-iii) 🔒 | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Hard |
-| 770 | [基本计算器 IV](../../problems/basic-calculator-iv) | [[栈](../stack/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Hard |
-| 767 | [重构字符串](../../problems/reorganize-string) | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Medium |
-| 761 | [特殊的二进制序列](../../problems/special-binary-string) | [[递归](../recursion/README.md)] [[字符串](../string/README.md)] | Hard |
-| 758 | [字符串中的加粗单词](../../problems/bold-words-in-string) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 736 | [Lisp 语法解析](../../problems/parse-lisp-expression) | [[字符串](../string/README.md)] | Hard |
-| 730 | [统计不同回文子序列](../../problems/count-different-palindromic-subsequences) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 722 | [删除注释](../../problems/remove-comments) | [[字符串](../string/README.md)] | Medium |
-| 709 | [转换成小写字母](../../problems/to-lower-case) | [[字符串](../string/README.md)] | Easy |
-| 696 | [计数二进制子串](../../problems/count-binary-substrings) | [[字符串](../string/README.md)] | Easy |
-| 686 | [重复叠加字符串匹配](../../problems/repeated-string-match) | [[字符串](../string/README.md)] | Medium |
-| 681 | [最近时刻](../../problems/next-closest-time) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 680 | [验证回文字符串 Ⅱ](../../problems/valid-palindrome-ii) | [[字符串](../string/README.md)] | Easy |
-| 678 | [有效的括号字符串](../../problems/valid-parenthesis-string) | [[字符串](../string/README.md)] | Medium |
-| 657 | [机器人能否返回原点](../../problems/robot-return-to-origin) | [[字符串](../string/README.md)] | Easy |
-| 647 | [回文子串](../../problems/palindromic-substrings) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 635 | [设计日志存储系统](../../problems/design-log-storage-system) 🔒 | [[设计](../design/README.md)] [[字符串](../string/README.md)] | Medium |
-| 632 | [最小区间](../../problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard |
-| 616 | [给字符串添加加粗标签](../../problems/add-bold-tag-in-string) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 609 | [在系统中查找重复文件](../../problems/find-duplicate-file-in-system) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 606 | [根据二叉树创建字符串](../../problems/construct-string-from-binary-tree) | [[树](../tree/README.md)] [[字符串](../string/README.md)] | Easy |
-| 591 | [标签验证器](../../problems/tag-validator) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Hard |
-| 583 | [两个字符串的删除操作](../../problems/delete-operation-for-two-strings) | [[字符串](../string/README.md)] | Medium |
-| 564 | [寻找最近的回文数](../../problems/find-the-closest-palindrome) | [[字符串](../string/README.md)] | Hard |
-| 557 | [反转字符串中的单词 III](../../problems/reverse-words-in-a-string-iii) | [[字符串](../string/README.md)] | Easy |
-| 556 | [下一个更大元素 III](../../problems/next-greater-element-iii) | [[字符串](../string/README.md)] | Medium |
-| 555 | [分割连接字符串](../../problems/split-concatenated-strings) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 553 | [最优除法](../../problems/optimal-division) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 551 | [学生出勤记录 I](../../problems/student-attendance-record-i) | [[字符串](../string/README.md)] | Easy |
-| 544 | [输出比赛匹配对](../../problems/output-contest-matches) 🔒 | [[递归](../recursion/README.md)] [[字符串](../string/README.md)] | Medium |
-| 541 | [反转字符串 II](../../problems/reverse-string-ii) | [[字符串](../string/README.md)] | Easy |
-| 539 | [最小时间差](../../problems/minimum-time-difference) | [[字符串](../string/README.md)] | Medium |
-| 537 | [复数乘法](../../problems/complex-number-multiplication) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 536 | [从字符串生成二叉树](../../problems/construct-binary-tree-from-string) 🔒 | [[树](../tree/README.md)] [[字符串](../string/README.md)] | Medium |
-| 527 | [单词缩写](../../problems/word-abbreviation) 🔒 | [[排序](../sort/README.md)] [[字符串](../string/README.md)] | Hard |
-| 522 | [最长特殊序列 II](../../problems/longest-uncommon-subsequence-ii) | [[字符串](../string/README.md)] | Medium |
-| 521 | [最长特殊序列 Ⅰ](../../problems/longest-uncommon-subsequence-i) | [[脑筋急转弯](../brainteaser/README.md)] [[字符串](../string/README.md)] | Easy |
-| 520 | [检测大写字母](../../problems/detect-capital) | [[字符串](../string/README.md)] | Easy |
-| 468 | [验证IP地址](../../problems/validate-ip-address) | [[字符串](../string/README.md)] | Medium |
-| 459 | [重复的子字符串](../../problems/repeated-substring-pattern) | [[字符串](../string/README.md)] | Easy |
-| 443 | [压缩字符串](../../problems/string-compression) | [[字符串](../string/README.md)] | Medium |
-| 434 | [字符串中的单词数](../../problems/number-of-segments-in-a-string) | [[字符串](../string/README.md)] | Easy |
-| 415 | [字符串相加](../../problems/add-strings) | [[字符串](../string/README.md)] | Easy |
-| 408 | [有效单词缩写](../../problems/valid-word-abbreviation) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 387 | [字符串中的第一个唯一字符](../../problems/first-unique-character-in-a-string) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Easy |
-| 385 | [迷你语法分析器](../../problems/mini-parser) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 383 | [赎金信](../../problems/ransom-note) | [[字符串](../string/README.md)] | Easy |
-| 345 | [反转字符串中的元音字母](../../problems/reverse-vowels-of-a-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
-| 344 | [反转字符串](../../problems/reverse-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
-| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
-| 336 | [回文对](../../problems/palindrome-pairs) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Hard |
-| 316 | [去除重复字母](../../problems/remove-duplicate-letters) | [[栈](../stack/README.md)] [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium |
-| 293 | [翻转游戏](../../problems/flip-game) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 273 | [整数转换英文表示](../../problems/integer-to-english-words) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard |
-| 271 | [字符串的编码与解码](../../problems/encode-and-decode-strings) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 249 | [移位字符串分组](../../problems/group-shifted-strings) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 227 | [基本计算器 II](../../problems/basic-calculator-ii) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 214 | [最短回文串](../../problems/shortest-palindrome) | [[字符串](../string/README.md)] | Hard |
-| 186 | [翻转字符串里的单词 II](../../problems/reverse-words-in-a-string-ii) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 165 | [比较版本号](../../problems/compare-version-numbers) | [[字符串](../string/README.md)] | Medium |
-| 161 | [相隔为 1 的编辑距离](../../problems/one-edit-distance) 🔒 | [[字符串](../string/README.md)] | Medium |
-| 159 | [至多包含两个不同字符的最长子串](../../problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
-| 158 | [用 Read4 读取 N 个字符 II](../../problems/read-n-characters-given-read4-ii-call-multiple-times) 🔒 | [[字符串](../string/README.md)] | Hard |
-| 157 | [用 Read4 读取 N 个字符](../../problems/read-n-characters-given-read4) 🔒 | [[字符串](../string/README.md)] | Easy |
-| 151 | [翻转字符串里的单词](../../problems/reverse-words-in-a-string) | [[字符串](../string/README.md)] | Medium |
-| 126 | [单词接龙 II](../../problems/word-ladder-ii) | [[广度优先搜索](../breadth-first-search/README.md)] [[数组](../array/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 125 | [验证回文串](../../problems/valid-palindrome) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
-| 115 | [不同的子序列](../../problems/distinct-subsequences) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 97 | [交错字符串](../../problems/interleaving-string) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 93 | [复原IP地址](../../problems/restore-ip-addresses) | [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 91 | [解码方法](../../problems/decode-ways) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 87 | [扰乱字符串](../../problems/scramble-string) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 76 | [最小覆盖子串](../../problems/minimum-window-substring) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard |
-| 72 | [编辑距离](../../problems/edit-distance) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 71 | [简化路径](../../problems/simplify-path) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Medium |
-| 68 | [文本左右对齐](../../problems/text-justification) | [[字符串](../string/README.md)] | Hard |
-| 67 | [二进制求和](../../problems/add-binary) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy |
-| 65 | [有效数字](../../problems/valid-number) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard |
-| 58 | [最后一个单词的长度](../../problems/length-of-last-word) | [[字符串](../string/README.md)] | Easy |
-| 49 | [字母异位词分组](../../problems/group-anagrams) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
-| 44 | [通配符匹配](../../problems/wildcard-matching) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 43 | [字符串相乘](../../problems/multiply-strings) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 38 | [外观数列](../../problems/count-and-say) | [[字符串](../string/README.md)] | Easy |
-| 32 | [最长有效括号](../../problems/longest-valid-parentheses) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
-| 30 | [串联所有单词的子串](../../problems/substring-with-concatenation-of-all-words) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard |
-| 28 | [实现 strStr()](../../problems/implement-strstr) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
-| 22 | [括号生成](../../problems/generate-parentheses) | [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 20 | [有效的括号](../../problems/valid-parentheses) | [[栈](../stack/README.md)] [[字符串](../string/README.md)] | Easy |
-| 17 | [电话号码的字母组合](../../problems/letter-combinations-of-a-phone-number) | [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium |
-| 14 | [最长公共前缀](../../problems/longest-common-prefix) | [[字符串](../string/README.md)] | Easy |
-| 13 | [罗马数字转整数](../../problems/roman-to-integer) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy |
-| 12 | [整数转罗马数字](../../problems/integer-to-roman) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 10 | [正则表达式匹配](../../problems/regular-expression-matching) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard |
-| 8 | [字符串转换整数 (atoi)](../../problems/string-to-integer-atoi) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium |
-| 6 | [Z 字形变换](../../problems/zigzag-conversion) | [[字符串](../string/README.md)] | Medium |
-| 5 | [最长回文子串](../../problems/longest-palindromic-substring) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium |
-| 3 | [无重复字符的最长子串](../../problems/longest-substring-without-repeating-characters) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
diff --git a/tag/tags.json b/tag/tags.json
index 820b1f6b7..dd04f1731 100644
--- a/tag/tags.json
+++ b/tag/tags.json
@@ -99,16 +99,16 @@
"Slug": "union-find",
"TranslatedName": "并查集"
},
- {
- "Name": "Sliding Window",
- "Slug": "sliding-window",
- "TranslatedName": "Sliding Window"
- },
{
"Name": "Recursion",
"Slug": "recursion",
"TranslatedName": "递归"
},
+ {
+ "Name": "Sliding Window",
+ "Slug": "sliding-window",
+ "TranslatedName": "Sliding Window"
+ },
{
"Name": "Divide and Conquer",
"Slug": "divide-and-conquer",
@@ -184,6 +184,11 @@
"Slug": "rolling-hash",
"TranslatedName": "Rolling Hash"
},
+ {
+ "Name": "Suffix Array",
+ "Slug": "suffix-array",
+ "TranslatedName": "Suffix Array"
+ },
{
"Name": "Rejection Sampling",
"Slug": "rejection-sampling",
@@ -194,11 +199,6 @@
"Slug": "reservoir-sampling",
"TranslatedName": "蓄水池抽样"
},
- {
- "Name": "Suffix Array",
- "Slug": "suffix-array",
- "TranslatedName": "Suffix Array"
- },
{
"Name": "Memoization",
"Slug": "memoization",
diff --git a/tag/tree/README.md b/tag/tree/README.md
index 10c1417de..0dd6cb631 100644
--- a/tag/tree/README.md
+++ b/tag/tree/README.md
@@ -141,20 +141,20 @@
| 145 | [二叉树的后序遍历](../../problems/binary-tree-postorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] | Medium |
| 144 | [二叉树的前序遍历](../../problems/binary-tree-preorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] | Medium |
| 129 | [求根到叶子节点数字之和](../../problems/sum-root-to-leaf-numbers) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
-| 124 | [二叉树中的最大路径和](../../problems/binary-tree-maximum-path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard |
+| 124 | [二叉树中的最大路径和](../../problems/binary-tree-maximum-path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Hard |
| 117 | [填充每个节点的下一个右侧节点指针 II](../../problems/populating-next-right-pointers-in-each-node-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 116 | [填充每个节点的下一个右侧节点指针](../../problems/populating-next-right-pointers-in-each-node) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 114 | [二叉树展开为链表](../../problems/flatten-binary-tree-to-linked-list) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 113 | [路径总和 II](../../problems/path-sum-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium |
| 112 | [路径总和](../../problems/path-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
| 111 | [二叉树的最小深度](../../problems/minimum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
-| 110 | [平衡二叉树](../../problems/balanced-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
+| 110 | [平衡二叉树](../../problems/balanced-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
| 108 | [将有序数组转换为二叉搜索树](../../problems/convert-sorted-array-to-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
-| 107 | [二叉树的层次遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
+| 107 | [二叉树的层序遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
| 106 | [从中序与后序遍历序列构造二叉树](../../problems/construct-binary-tree-from-inorder-and-postorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium |
| 105 | [从前序与中序遍历序列构造二叉树](../../problems/construct-binary-tree-from-preorder-and-inorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium |
| 104 | [二叉树的最大深度](../../problems/maximum-depth-of-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy |
-| 103 | [二叉树的锯齿形层次遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
+| 103 | [二叉树的锯齿形层序遍历](../../problems/binary-tree-zigzag-level-order-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 102 | [二叉树的层序遍历](../../problems/binary-tree-level-order-traversal) | [[树](../tree/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium |
| 101 | [对称二叉树](../../problems/symmetric-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy |
| 100 | [相同的树](../../problems/same-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy |
diff --git a/tag/trie/README.md b/tag/trie/README.md
index b819271ee..a008b2d35 100644
--- a/tag/trie/README.md
+++ b/tag/trie/README.md
@@ -9,6 +9,7 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1707 | [与数组中元素的最大异或值](../../problems/maximum-xor-with-an-element-from-array) | [[位运算](../bit-manipulation/README.md)] [[字典树](../trie/README.md)] | Hard |
| 1638 | [统计只差一个字符的子串数目](../../problems/count-substrings-that-differ-by-one-character) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium |
| 1065 | [字符串的索引对](../../problems/index-pairs-of-a-string) 🔒 | [[字典树](../trie/README.md)] [[字符串](../string/README.md)] | Easy |
| 1032 | [字符流](../../problems/stream-of-characters) | [[字典树](../trie/README.md)] | Hard |
diff --git a/tag/two-pointers/README.md b/tag/two-pointers/README.md
index 1cd23c4b5..bbccc6652 100644
--- a/tag/two-pointers/README.md
+++ b/tag/two-pointers/README.md
@@ -9,6 +9,7 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
+| 1695 | [删除子数组的最大得分](../../problems/maximum-erasure-value) | [[双指针](../two-pointers/README.md)] | Medium |
| 1687 | [从仓库到码头运输箱子](../../problems/delivering-boxes-from-storage-to-ports) | [[线段树](../segment-tree/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard |
| 1658 | [将 x 减到 0 的最小操作数](../../problems/minimum-operations-to-reduce-x-to-zero) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
| 1616 | [分割两个字符串得到回文串](../../problems/split-two-strings-to-make-palindrome) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Medium |
@@ -49,6 +50,7 @@
| 349 | [两个数组的交集](../../problems/intersection-of-two-arrays) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy |
| 345 | [反转字符串中的元音字母](../../problems/reverse-vowels-of-a-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
| 344 | [反转字符串](../../problems/reverse-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy |
+| 340 | [至多包含 K 个不同字符的最长子串](../../problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium |
| 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
| 283 | [移动零](../../problems/move-zeroes) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy |
| 259 | [较小的三数之和](../../problems/3sum-smaller) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium |
diff --git a/tag/union-find/README.md b/tag/union-find/README.md
index 1fc59b219..e84ea907e 100644
--- a/tag/union-find/README.md
+++ b/tag/union-find/README.md
@@ -9,38 +9,3 @@
| # | 题目 | 标签 | 难度 |
| :-: | - | - | :-: |
-| 1632 | [矩阵转换后的秩](../../problems/rank-transform-of-a-matrix) | [[贪心算法](../greedy/README.md)] [[并查集](../union-find/README.md)] | Hard |
-| 1631 | [最小体力消耗路径](../../problems/path-with-minimum-effort) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[二分查找](../binary-search/README.md)] | Medium |
-| 1627 | [带阈值的图连通性](../../problems/graph-connectivity-with-threshold) | [[并查集](../union-find/README.md)] [[数学](../math/README.md)] | Hard |
-| 1584 | [连接所有点的最小费用](../../problems/min-cost-to-connect-all-points) | [[并查集](../union-find/README.md)] | Medium |
-| 1579 | [保证图可完全遍历](../../problems/remove-max-number-of-edges-to-keep-graph-fully-traversable) | [[并查集](../union-find/README.md)] | Hard |
-| 1489 | [找到最小生成树里的关键边和伪关键边](../../problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Hard |
-| 1319 | [连通网络的操作次数](../../problems/number-of-operations-to-make-network-connected) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 1202 | [交换字符串中的元素](../../problems/smallest-string-with-swaps) | [[并查集](../union-find/README.md)] [[数组](../array/README.md)] | Medium |
-| 1168 | [水资源分配优化](../../problems/optimize-water-distribution-in-a-village) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
-| 1135 | [最低成本联通所有城市](../../problems/connecting-cities-with-minimum-cost) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 1102 | [得分最高的路径](../../problems/path-with-maximum-minimum-value) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 1101 | [彼此熟识的最早时间](../../problems/the-earliest-moment-when-everyone-become-friends) 🔒 | [[并查集](../union-find/README.md)] | Medium |
-| 1061 | [按字典序排列最小的等效字符串](../../problems/lexicographically-smallest-equivalent-string) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 990 | [等式方程的可满足性](../../problems/satisfiability-of-equality-equations) | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 959 | [由斜杠划分区域](../../problems/regions-cut-by-slashes) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 952 | [按公因数计算最大组件大小](../../problems/largest-component-size-by-common-factor) | [[并查集](../union-find/README.md)] [[数学](../math/README.md)] | Hard |
-| 947 | [移除最多的同行或同列石头](../../problems/most-stones-removed-with-same-row-or-column) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 928 | [尽量减少恶意软件的传播 II](../../problems/minimize-malware-spread-ii) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
-| 924 | [尽量减少恶意软件的传播](../../problems/minimize-malware-spread) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Hard |
-| 839 | [相似字符串组](../../problems/similar-string-groups) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
-| 803 | [打砖块](../../problems/bricks-falling-when-hit) | [[并查集](../union-find/README.md)] | Hard |
-| 778 | [水位上升的泳池中游泳](../../problems/swim-in-rising-water) | [[堆](../heap/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[二分查找](../binary-search/README.md)] | Hard |
-| 765 | [情侣牵手](../../problems/couples-holding-hands) | [[贪心算法](../greedy/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
-| 737 | [句子相似性 II](../../problems/sentence-similarity-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 721 | [账户合并](../../problems/accounts-merge) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 685 | [冗余连接 II](../../problems/redundant-connection-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard |
-| 684 | [冗余连接](../../problems/redundant-connection) | [[树](../tree/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 547 | [朋友圈](../../problems/friend-circles) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 399 | [除法求值](../../problems/evaluate-division) | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 323 | [无向图中连通分量的数目](../../problems/number-of-connected-components-in-an-undirected-graph) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 305 | [岛屿数量 II](../../problems/number-of-islands-ii) 🔒 | [[并查集](../union-find/README.md)] | Hard |
-| 261 | [以图判树](../../problems/graph-valid-tree) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium |
-| 200 | [岛屿数量](../../problems/number-of-islands) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 130 | [被围绕的区域](../../problems/surrounded-regions) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium |
-| 128 | [最长连续序列](../../problems/longest-consecutive-sequence) | [[并查集](../union-find/README.md)] [[数组](../array/README.md)] | Hard |