diff --git a/internal/leetcode/topic_tag.go b/internal/leetcode/topic_tag.go index 355980140..c6e9d4cc9 100644 --- a/internal/leetcode/topic_tag.go +++ b/internal/leetcode/topic_tag.go @@ -38,11 +38,13 @@ func (tag *TagType) SaveContents() { buf.WriteString("| # | 题目 | 标签 | 难度 |\n") buf.WriteString("| :-: | - | - | :-: |\n") format := "| %d | [%s](../../problems/%s)%s | %s | %s |\n" + preID := 0 for _, question := range questions { if question.TranslatedTitle == "" { question.TranslatedTitle = question.Title } - if question.frontendID() > 0 { + if question.frontendID() > 0 && question.frontendID() != preID { + preID = question.frontendID() buf.WriteString(fmt.Sprintf(format, question.frontendID(), question.TranslatedTitle, question.TitleSlug, question.IsPaidOnly.Str(), question.TagsStr(), question.Difficulty)) } } diff --git a/internal/version/version.go b/internal/version/version.go index 15f7bb386..6886a1b9d 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -8,7 +8,7 @@ import ( "github.com/openset/leetcode/internal/base" ) -const version = "1.5.3" +const version = "1.6.0" // CmdVersion - version.CmdVersion var CmdVersion = &base.Command{ diff --git a/problems/backspace-string-compare/README.md b/problems/backspace-string-compare/README.md index 45441ffdd..6e263c3aa 100644 --- a/problems/backspace-string-compare/README.md +++ b/problems/backspace-string-compare/README.md @@ -13,6 +13,8 @@
Given two strings S
and T
, return if they are equal when both are typed into empty text editors. #
means a backspace character.
Note that after backspacing an empty text, the text will continue empty.
+Example 1:
@@ -51,11 +53,11 @@Note:
-1 <= S.length <= 200
1 <= T.length <= 200
S
and T
only contain lowercase letters and '#'
characters.Follow up:
diff --git a/problems/capital-gainloss/README.md b/problems/capital-gainloss/README.md index cd4960a2b..990cd2437 100644 --- a/problems/capital-gainloss/README.md +++ b/problems/capital-gainloss/README.md @@ -11,4 +11,56 @@ ## [1393. Capital Gain/Loss (Medium)](https://leetcode.com/problems/capital-gainloss "股票的资本损益") +Table: Stocks
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| stock_name | varchar | +| operation | enum | +| operation_day | int | +| price | int | ++---------------+---------+ +(stock_name, day) is the primary key for this table. +The operation column is an ENUM of type ('Sell', 'Buy') +Each row of this table indicates that the stock which has stock_name had an operation on the day operation_day with the price. +It is guaranteed that each 'Sell' operation for a stock has a corresponding 'Buy' operation in a previous day. ++ +Write an SQL query to report the Capital gain/loss for each stock. +The capital gain/loss of a stock is total gain or loss after buying and selling the stock one or many times. + +Return the result table in any order. + +The query result format is in the following example: + +
+Stocks table: ++---------------+-----------+---------------+--------+ +| stock_name | operation | operation_day | price | ++---------------+-----------+---------------+--------+ +| Leetcode | Buy | 1 | 1000 | +| Corona Masks | Buy | 2 | 10 | +| Leetcode | Sell | 5 | 9000 | +| Handbags | Buy | 17 | 30000 | +| Corona Masks | Sell | 3 | 1010 | +| Corona Masks | Buy | 4 | 1000 | +| Corona Masks | Sell | 5 | 500 | +| Corona Masks | Buy | 6 | 1000 | +| Handbags | Sell | 29 | 7000 | +| Corona Masks | Sell | 10 | 10000 | ++---------------+-----------+---------------+--------+ + +Result table: ++---------------+-------------------+ +| stock_name | capital_gain_loss | ++---------------+-------------------+ +| Corona Masks | 9500 | +| Leetcode | 8000 | +| Handbags | -23000 | ++---------------+-------------------+ +Leetcode stock was bought at day 1 for 1000$ and was sold at day 5 for 9000$. Capital gain = 9000 - 1000 = 8000$. +Handbags stock was bought at day 17 for 30000$ and was sold at day 29 for 7000$. Capital loss = 7000 - 30000 = -23000$. +Corona Masks stock was bought at day 1 for 10$ and was sold at day 3 for 1010$. It was bought again at day 4 for 1000$ and was sold at day 5 for 500$. At last, it was bought at day 6 for 1000$ and was sold at day 10 for 10000$. Capital gain/loss is the sum of capital gains/losses for each ('Buy' --> 'Sell') operation = (1010 - 10) + (500 - 1000) + (10000 - 1000) = 1000 - 500 + 9000 = 9500$. +diff --git a/problems/customers-who-bought-products-a-and-b-but-not-c/README.md b/problems/customers-who-bought-products-a-and-b-but-not-c/README.md index cf518607c..07a9674a7 100644 --- a/problems/customers-who-bought-products-a-and-b-but-not-c/README.md +++ b/problems/customers-who-bought-products-a-and-b-but-not-c/README.md @@ -11,4 +11,68 @@ ## [1398. Customers Who Bought Products A and B but Not C (Medium)](https://leetcode.com/problems/customers-who-bought-products-a-and-b-but-not-c "购买了产品A和产品B却没有购买产品C的顾客") +
Table: Customers
++---------------------+---------+ +| Column Name | Type | ++---------------------+---------+ +| customer_id | int | +| customer_name | varchar | ++---------------------+---------+ +customer_id is the primary key for this table. +customer_name is the name of the customer. ++ +
Table: Orders
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| order_id | int | +| customer_id | int | +| product_name | varchar | ++---------------+---------+ +order_id is the primary key for this table. +customer_id is the id of the customer who bought the product "product_name". ++ +Write an SQL query to report the customer_id and customer_name of customers who bought products "A", "B" but did not buy the product "C" since we want to recommend them buy this product. +Return the result table ordered by customer_id. + +The query result format is in the following example. + +
+Customers table: ++-------------+---------------+ +| customer_id | customer_name | ++-------------+---------------+ +| 1 | Daniel | +| 2 | Diana | +| 3 | Elizabeth | +| 4 | Jhon | ++-------------+---------------+ + +Orders table: ++------------+--------------+---------------+ +| order_id | customer_id | product_name | ++------------+--------------+---------------+ +| 10 | 1 | A | +| 20 | 1 | B | +| 30 | 1 | D | +| 40 | 1 | C | +| 50 | 2 | A | +| 60 | 3 | A | +| 70 | 3 | B | +| 80 | 3 | D | +| 90 | 4 | C | ++------------+--------------+---------------+ + +Result table: ++-------------+---------------+ +| customer_id | customer_name | ++-------------+---------------+ +| 3 | Elizabeth | ++-------------+---------------+ +Only the customer_id with id 3 bought the product A and B but not the product C. +diff --git a/problems/delete-columns-to-make-sorted/README.md b/problems/delete-columns-to-make-sorted/README.md index 8c8aef867..82afaae3d 100644 --- a/problems/delete-columns-to-make-sorted/README.md +++ b/problems/delete-columns-to-make-sorted/README.md @@ -15,54 +15,46 @@
Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices.
-For example, if we have an array A = ["
abcdef
","uvwxyz"]
and deletion indices {0, 2, 3}
, then the final array after deletions is ["bef", "vyz"]
, and the remaining columns of A
are ["b"
,"
v"]
, ["e","y"]
, and ["f","z"]
. (Formally, the c
-th column is [A[0][c], A[1][c], ..., A[A.length-1][c]]
.)
For example, if we have an array A = ["abcdef","uvwxyz"]
and deletion indices {0, 2, 3}
, then the final array after deletions is ["bef", "vyz"]
, and the remaining columns of A
are ["b","v"]
, ["e","y"]
, and ["f","z"]
. (Formally, the c
-th column is [A[0][c], A[1][c], ..., A[A.length-1][c]]
).
Suppose we chose a set of deletion indices D
such that after deletions, each remaining column in A is in non-decreasing sorted order.
Return the minimum possible value of D.length
.
- -
Example 1:
-Input: ["cba","daf","ghi"] -Output: 1 +Input: A = ["cba","daf","ghi"] +Output: 1 Explanation: After choosing D = {1}, each column ["c","d","g"] and ["a","f","i"] are in non-decreasing sorted order. If we chose D = {}, then a column ["b","a","h"] would not be in non-decreasing sorted order.-
Example 2:
-Input: ["a","b"] -Output: 0 +Input: A = ["a","b"] +Output: 0 Explanation: D = {}-
Example 3:
-Input: ["zyx","wvu","tsr"] -Output: 3 +Input: A = ["zyx","wvu","tsr"] +Output: 3 Explanation: D = {0, 1, 2}
+
Constraints:
-Note:
- -1 <= A.length <= 100
1 <= A[i].length <= 1000
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "ACE"
is a subsequence of "ABCDE"
while "AEC"
is not).
It's guaranteed the answer fits on a 32-bit signed integer.
+Example 1:
Input: S ="rabbbit"
, T ="rabbit" Output: 3 -
Explanation: - +Explanation: As shown below, there are 3 ways you can generate "rabbit" from S. (The caret symbol ^ means the chosen letters) @@ -38,8 +39,7 @@ As shown below, there are 3 ways you can generate "rabbit" from S.Input: S ="babgbag"
, T ="bag" Output: 5 -
Explanation: - +Explanation: As shown below, there are 5 ways you can generate "bag" from S. (The caret symbol ^ means the chosen letters) diff --git a/problems/get-the-second-most-recent-activity/README.md b/problems/get-the-second-most-recent-activity/README.md index 572594895..a98a5e3d4 100644 --- a/problems/get-the-second-most-recent-activity/README.md +++ b/problems/get-the-second-most-recent-activity/README.md @@ -11,4 +11,48 @@ ## [1369. Get the Second Most Recent Activity (Hard)](https://leetcode.com/problems/get-the-second-most-recent-activity "获取最近第二次的活动") +SQL Schema +Table:
+UserActivity
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| username | varchar | +| activity | varchar | +| startDate | Date | +| endDate | Date | ++---------------+---------+ +This table does not contain primary key. +This table contain information about the activity performed of each user in a period of time. +A person with username performed a activity from startDate to endDate. ++Write an SQL query to show the second most recent activity of each user. + +If the user only has one activity, return that one. + +A user can't perform more than one activity at the same time. Return the result table in any order. + +The query result format is in the following example: ++UserActivity table: ++------------+--------------+-------------+-------------+ +| username | activity | startDate | endDate | ++------------+--------------+-------------+-------------+ +| Alice | Travel | 2020-02-12 | 2020-02-20 | +| Alice | Dancing | 2020-02-21 | 2020-02-23 | +| Alice | Travel | 2020-02-24 | 2020-02-28 | +| Bob | Travel | 2020-02-11 | 2020-02-18 | ++------------+--------------+-------------+-------------+ + +Result table: ++------------+--------------+-------------+-------------+ +| username | activity | startDate | endDate | ++------------+--------------+-------------+-------------+ +| Alice | Dancing | 2020-02-21 | 2020-02-23 | +| Bob | Travel | 2020-02-11 | 2020-02-18 | ++------------+--------------+-------------+-------------+ + +The most recent activity of Alice is Travel from 2020-02-24 to 2020-02-28, before that she was dancing from 2020-02-21 to 2020-02-23. +Bob only has one record, we just take that one. +diff --git a/problems/longest-uncommon-subsequence-i/README.md b/problems/longest-uncommon-subsequence-i/README.md index c4b156e8d..3f3f4d2ed 100644 --- a/problems/longest-uncommon-subsequence-i/README.md +++ b/problems/longest-uncommon-subsequence-i/README.md @@ -11,33 +11,45 @@ ## [521. Longest Uncommon Subsequence I (Easy)](https://leetcode.com/problems/longest-uncommon-subsequence-i "最长特殊序列 Ⅰ") --Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. -The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this subsequence should not be any subsequence of the other strings. -
+Given two strings, you need to find the longest uncommon subsequence of this two strings. The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this subsequence should not be any subsequence of the other string.
--A subsequence is a sequence that can be derived from one sequence by deleting some characters without changing the order of the remaining elements. Trivially, any string is a subsequence of itself and an empty string is a subsequence of any string. -
+A subsequence is a sequence that can be derived from one sequence by deleting some characters without changing the order of the remaining elements. Trivially, any string is a subsequence of itself and an empty string is a subsequence of any string.
--The input will be two strings, and the output needs to be the length of the longest uncommon subsequence. If the longest uncommon subsequence doesn't exist, return -1. -
+The input will be two strings, and the output needs to be the length of the longest uncommon subsequence. If the longest uncommon subsequence doesn't exist, return -1.
+ ++
Example 1:
+ ++Input: a = "aba", b = "cdc" +Output: 3 +Explanation: The longest uncommon subsequence is "aba", +because "aba" is a subsequence of "aba", +but not a subsequence of the other string "cdc". +Note that "cdc" can be also a longest uncommon subsequence. ++ +Example 2:
-Example 1:
-Input: "aba", "cdc" -Output: 3 -Explanation: The longest uncommon subsequence is "aba" (or "cdc"),- - -
because "aba" is a subsequence of "aba",
but not a subsequence of any other strings in the group of two strings. +Input: a = "aaa", b = "bbb" +Output: 3Note: -
-
- + +- Both strings' lengths will not exceed 100.
-- Only letters from a ~ z will appear in input strings.
-Example 3:
+ ++Input: a = "aaa", b = "aaa" +Output: -1 ++ ++
Constraints:
+ +
[1 - 100]
.In a list of songs, the i
-th song has a duration of time[i]
seconds.
Return the number of pairs of songs for which their total duration in seconds is divisible by 60
. Formally, we want the number of indices i < j
with (time[i] + time[j]) % 60 == 0
.
Return the number of pairs of songs for which their total duration in seconds is divisible by 60
. Formally, we want the number of indices i
, j
such that i < j
with (time[i] + time[j]) % 60 == 0
.
@@ -42,10 +42,10 @@
Note:
-1 <= time.length <= 60000
1 <= time[i] <= 500
Table: Employees
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| id | int | +| name | varchar | ++---------------+---------+ +id is the primary key for this table. +Each row of this table contains the id and the name of an employee in a company. ++ +
Table: EmployeeUNI
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| id | int | +| unique_id | int | ++---------------+---------+ +(id, unique_id) is the primary key for this table. +Each row of this table contains the id and the corresponding unique id of an employee in the company. ++ +Write an SQL query to show the unique ID of each user, If a user doesn't have a unique ID replace just show null. +Return the result table in any order. + +The query result format is in the following example: +
+Employees table: ++----+----------+ +| id | name | ++----+----------+ +| 1 | Alice | +| 7 | Bob | +| 11 | Meir | +| 90 | Winston | +| 3 | Jonathan | ++----+----------+ + +EmployeeUNI table: ++----+-----------+ +| id | unique_id | ++----+-----------+ +| 3 | 1 | +| 11 | 2 | +| 90 | 3 | ++----+-----------+ + +EmployeeUNI table: ++-----------+----------+ +| unique_id | name | ++-----------+----------+ +| null | Alice | +| null | Bob | +| 2 | Meir | +| 3 | Winston | +| 1 | Jonathan | ++-----------+----------+ + +Alice and Bob don't have a unique ID, We will show null instead. +The unique ID of Meir is 2. +The unique ID of Winston is 3. +The unique ID of Jonathan is 1. +diff --git a/problems/top-travellers/README.md b/problems/top-travellers/README.md index 57fc5d75e..d35e3c7f6 100644 --- a/problems/top-travellers/README.md +++ b/problems/top-travellers/README.md @@ -11,4 +11,78 @@ ## [1407. Top Travellers (Easy)](https://leetcode.com/problems/top-travellers "") +
Table: Users
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| id | int | +| name | varchar | ++---------------+---------+ +id is the primary key for this table. +name is the name of the user. ++ +
Table: Rides
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| id | int | +| user_id | int | +| distance | int | ++---------------+---------+ +id is the primary key for this table. +city_id is the id of the city who bought the product "product_name". ++ +Write an SQL query to report the distance travelled by each user. +Return the result table ordered by travelled_distance in descending order, if two or more users travelled the same distance, order them by their name in ascending order. + +The query result format is in the following example. +
+Users table: ++------+-----------+ +| id | name | ++------+-----------+ +| 1 | Alice | +| 2 | Bob | +| 3 | Alex | +| 4 | Donald | +| 7 | Lee | +| 13 | Jonathan | +| 19 | Elvis | ++------+-----------+ + +Rides table: ++------+----------+----------+ +| id | user_id | distance | ++------+----------+----------+ +| 1 | 1 | 120 | +| 2 | 2 | 317 | +| 3 | 3 | 222 | +| 4 | 7 | 100 | +| 5 | 13 | 312 | +| 6 | 19 | 50 | +| 7 | 7 | 120 | +| 8 | 19 | 400 | +| 9 | 7 | 230 | ++------+----------+----------+ + +Result table: ++----------+--------------------+ +| name | travelled_distance | ++----------+--------------------+ +| Elvis | 450 | +| Lee | 450 | +| Bob | 317 | +| Jonathan | 312 | +| Alex | 222 | +| Alice | 120 | +| Donald | 0 | ++----------+--------------------+ +Elvis and Lee travelled 450 miles, Elvis is the top traveller as his name is alphabetically smaller than Lee. +Bob, Jonathan, Alex and Alice have only one ride and we just order them by the total distances of the ride. +Donald didn't have any rides, the distance travelled by him is 0. +diff --git a/problems/total-sales-amount-by-year/README.md b/problems/total-sales-amount-by-year/README.md index 415c11781..87ed722ca 100644 --- a/problems/total-sales-amount-by-year/README.md +++ b/problems/total-sales-amount-by-year/README.md @@ -11,4 +11,70 @@ ## [1384. Total Sales Amount by Year (Hard)](https://leetcode.com/problems/total-sales-amount-by-year "按年度列出销售总额") +
Table: Product
++---------------+---------+ +| Column Name | Type | ++---------------+---------+ +| product_id | int | +| product_name | varchar | ++---------------+---------+ +product_id is the primary key for this table. +product_name is the name of the product. ++ +
Table: Sales
++---------------------+---------+ +| Column Name | Type | ++---------------------+---------+ +| product_id | int | +| period_start | varchar | +| period_end | date | +| average_daily_sales | int | ++---------------------+---------+ +product_id is the primary key for this table. +period_start and period_end indicates the start and end date for sales period, both dates are inclusive. +The average_daily_sales column holds the average daily sales amount of the items for the period. ++Write an SQL query to report the Total sales amount of each item for each year, with corresponding product name, product_id, product_name and report_year. + +Dates of the sales years are between 2018 to 2020. Return the result table ordered by product_id and report_year. + +The query result format is in the following example: + +
+Product table: ++------------+--------------+ +| product_id | product_name | ++------------+--------------+ +| 1 | LC Phone | +| 2 | LC T-Shirt | +| 3 | LC Keychain | ++------------+--------------+ + +Sales table: ++------------+--------------+-------------+---------------------+ +| product_id | period_start | period_end | average_daily_sales | ++------------+--------------+-------------+---------------------+ +| 1 | 2019-01-25 | 2019-02-28 | 100 | +| 2 | 2018-12-01 | 2020-01-01 | 10 | +| 3 | 2019-12-01 | 2020-01-31 | 1 | ++------------+--------------+-------------+---------------------+ + +Result table: ++------------+--------------+-------------+--------------+ +| product_id | product_name | report_year | total_amount | ++------------+--------------+-------------+--------------+ +| 1 | LC Phone | 2019 | 3500 | +| 2 | LC T-Shirt | 2018 | 310 | +| 2 | LC T-Shirt | 2019 | 3650 | +| 2 | LC T-Shirt | 2020 | 10 | +| 3 | LC Keychain | 2019 | 31 | +| 3 | LC Keychain | 2020 | 31 | ++------------+--------------+-------------+--------------+ +LC Phone was sold for the period of 2019-01-25 to 2019-02-28, and there are 35 days for this period. Total amount 35*100 = 3500. +LC T-shirt was sold for the period of 2018-12-01 to 2020-01-01, and there are 31, 365, 1 days for years 2018, 2019 and 2020 respectively. +LC Keychain was sold for the period of 2019-12-01 to 2020-01-31, and there are 31, 31 days for years 2019 and 2020 respectively. +diff --git a/problems/word-ladder/README.md b/problems/word-ladder/README.md index 6e83286d9..008dce79f 100644 --- a/problems/word-ladder/README.md +++ b/problems/word-ladder/README.md @@ -15,7 +15,7 @@
Note:
diff --git a/tag/binary-search/README.md b/tag/binary-search/README.md index 4e2cb4d67..fd809ab4a 100644 --- a/tag/binary-search/README.md +++ b/tag/binary-search/README.md @@ -10,171 +10,86 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | | 1351 | [统计有序矩阵中的负数](../../problems/count-negative-numbers-in-a-sorted-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1351 | [统计有序矩阵中的负数](../../problems/count-negative-numbers-in-a-sorted-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1337 | [方阵中战斗力最弱的 K 行](../../problems/the-k-weakest-rows-in-a-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 1337 | [方阵中战斗力最弱的 K 行](../../problems/the-k-weakest-rows-in-a-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 1300 | [转变数组后最接近目标值的数组和](../../problems/sum-of-mutated-array-closest-to-target) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 1300 | [转变数组后最接近目标值的数组和](../../problems/sum-of-mutated-array-closest-to-target) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 1292 | [元素和小于等于阈值的正方形的最大边长](../../problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1292 | [元素和小于等于阈值的正方形的最大边长](../../problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1283 | [使结果不超过阈值的最小除数](../../problems/find-the-smallest-divisor-given-a-threshold) | [[二分查找](../binary-search/README.md)] | Medium | | 1237 | [找出给定方程的正整数解](../../problems/find-positive-integer-solution-for-a-given-equation) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1237 | [找出给定方程的正整数解](../../problems/find-positive-integer-solution-for-a-given-equation) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1235 | [规划兼职工作](../../problems/maximum-profit-in-job-scheduling) | [[排序](../sort/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 1235 | [规划兼职工作](../../problems/maximum-profit-in-job-scheduling) | [[排序](../sort/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 1231 | [分享巧克力](../../problems/divide-chocolate) 🔒 | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1231 | [分享巧克力](../../problems/divide-chocolate) 🔒 | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1201 | [丑数 III](../../problems/ugly-number-iii) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1201 | [丑数 III](../../problems/ugly-number-iii) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1198 | [找出所有行中最小公共元素](../../problems/find-smallest-common-element-in-all-rows) 🔒 | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 1198 | [找出所有行中最小公共元素](../../problems/find-smallest-common-element-in-all-rows) 🔒 | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1182 | [与目标颜色间的最短距离](../../problems/shortest-distance-to-target-color) 🔒 | [[二分查找](../binary-search/README.md)] | Medium | | 1157 | [子数组中占绝大多数的元素](../../problems/online-majority-element-in-subarray) | [[线段树](../segment-tree/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1157 | [子数组中占绝大多数的元素](../../problems/online-majority-element-in-subarray) | [[线段树](../segment-tree/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1157 | [子数组中占绝大多数的元素](../../problems/online-majority-element-in-subarray) | [[线段树](../segment-tree/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 1150 | [检查一个数是否在数组中占绝大多数](../../problems/check-if-a-number-is-majority-element-in-a-sorted-array) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1150 | [检查一个数是否在数组中占绝大多数](../../problems/check-if-a-number-is-majority-element-in-a-sorted-array) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1111 | [有效括号的嵌套深度](../../problems/maximum-nesting-depth-of-two-valid-parentheses-strings) | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1111 | [有效括号的嵌套深度](../../problems/maximum-nesting-depth-of-two-valid-parentheses-strings) | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1095 | [山脉数组中查找目标值](../../problems/find-in-mountain-array) | [[二分查找](../binary-search/README.md)] | Hard | | 1064 | [不动点](../../problems/fixed-point) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 1064 | [不动点](../../problems/fixed-point) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 1060 | [有序数组中的缺失元素](../../problems/missing-element-in-sorted-array) 🔒 | [[二分查找](../binary-search/README.md)] | Medium | | 1044 | [最长重复子串](../../problems/longest-duplicate-substring) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1044 | [最长重复子串](../../problems/longest-duplicate-substring) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 1011 | [在 D 天内送达包裹的能力](../../problems/capacity-to-ship-packages-within-d-days) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1011 | [在 D 天内送达包裹的能力](../../problems/capacity-to-ship-packages-within-d-days) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 981 | [基于时间的键值存储](../../problems/time-based-key-value-store) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 981 | [基于时间的键值存储](../../problems/time-based-key-value-store) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 927 | [三等分](../../problems/three-equal-parts) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 927 | [三等分](../../problems/three-equal-parts) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 927 | [三等分](../../problems/three-equal-parts) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 911 | [在线选举](../../problems/online-election) | [[二分查找](../binary-search/README.md)] | Medium | | 887 | [鸡蛋掉落](../../problems/super-egg-drop) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | -| 887 | [鸡蛋掉落](../../problems/super-egg-drop) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | -| 878 | [第 N 个神奇数字](../../problems/nth-magical-number) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 878 | [第 N 个神奇数字](../../problems/nth-magical-number) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 875 | [爱吃香蕉的珂珂](../../problems/koko-eating-bananas) | [[二分查找](../binary-search/README.md)] | Medium | | 862 | [和至少为 K 的最短子数组](../../problems/shortest-subarray-with-sum-at-least-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 862 | [和至少为 K 的最短子数组](../../problems/shortest-subarray-with-sum-at-least-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 852 | [山脉数组的峰顶索引](../../problems/peak-index-in-a-mountain-array) | [[二分查找](../binary-search/README.md)] | Easy | | 793 | [阶乘函数后K个零](../../problems/preimage-size-of-factorial-zeroes-function) | [[二分查找](../binary-search/README.md)] | Hard | | 786 | [第 K 个最小的素数分数](../../problems/k-th-smallest-prime-fraction) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 786 | [第 K 个最小的素数分数](../../problems/k-th-smallest-prime-fraction) | [[堆](../heap/README.md)] [[二分查找](../binary-search/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 | -| 778 | [水位上升的泳池中游泳](../../problems/swim-in-rising-water) | [[堆](../heap/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[二分查找](../binary-search/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 | | 778 | [水位上升的泳池中游泳](../../problems/swim-in-rising-water) | [[堆](../heap/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 774 | [最小化去加油站的最大距离](../../problems/minimize-max-distance-to-gas-station) 🔒 | [[二分查找](../binary-search/README.md)] | Hard | | 744 | [寻找比目标字母大的最小字母](../../problems/find-smallest-letter-greater-than-target) | [[二分查找](../binary-search/README.md)] | Easy | | 719 | [找出第 k 小的距离对](../../problems/find-k-th-smallest-pair-distance) | [[堆](../heap/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 719 | [找出第 k 小的距离对](../../problems/find-k-th-smallest-pair-distance) | [[堆](../heap/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 719 | [找出第 k 小的距离对](../../problems/find-k-th-smallest-pair-distance) | [[堆](../heap/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/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 | -| 718 | [最长重复子数组](../../problems/maximum-length-of-repeated-subarray) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | -| 718 | [最长重复子数组](../../problems/maximum-length-of-repeated-subarray) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/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 | -| 710 | [黑名单中的随机数](../../problems/random-pick-with-blacklist) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Hard | -| 710 | [黑名单中的随机数](../../problems/random-pick-with-blacklist) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Hard | | 710 | [黑名单中的随机数](../../problems/random-pick-with-blacklist) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Hard | | 704 | [二分查找](../../problems/binary-search) | [[二分查找](../binary-search/README.md)] | Easy | | 702 | [搜索长度未知的有序数组](../../problems/search-in-a-sorted-array-of-unknown-size) 🔒 | [[二分查找](../binary-search/README.md)] | Medium | | 668 | [乘法表中第k小的数](../../problems/kth-smallest-number-in-multiplication-table) | [[二分查找](../binary-search/README.md)] | Hard | | 658 | [找到 K 个最接近的元素](../../problems/find-k-closest-elements) | [[二分查找](../binary-search/README.md)] | Medium | | 644 | [最大平均子段和 II](../../problems/maximum-average-subarray-ii) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 644 | [最大平均子段和 II](../../problems/maximum-average-subarray-ii) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 528 | [按权重随机选择](../../problems/random-pick-with-weight) | [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Medium | | 528 | [按权重随机选择](../../problems/random-pick-with-weight) | [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Medium | | 497 | [非重叠矩形中的随机点](../../problems/random-point-in-non-overlapping-rectangles) | [[二分查找](../binary-search/README.md)] [[Random](../random/README.md)] | Medium | -| 497 | [非重叠矩形中的随机点](../../problems/random-point-in-non-overlapping-rectangles) | [[二分查找](../binary-search/README.md)] [[Random](../random/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 | -| 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 | | 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 | -| 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 | -| 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 | -| 483 | [最小好进制](../../problems/smallest-good-base) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 483 | [最小好进制](../../problems/smallest-good-base) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 475 | [供暖器](../../problems/heaters) | [[二分查找](../binary-search/README.md)] | Easy | | 454 | [四数相加 II](../../problems/4sum-ii) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 454 | [四数相加 II](../../problems/4sum-ii) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 441 | [排列硬币](../../problems/arranging-coins) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 441 | [排列硬币](../../problems/arranging-coins) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 436 | [寻找右区间](../../problems/find-right-interval) | [[二分查找](../binary-search/README.md)] | Medium | | 410 | [分割数组的最大值](../../problems/split-array-largest-sum) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 392 | [判断子序列](../../problems/is-subsequence) | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy | -| 392 | [判断子序列](../../problems/is-subsequence) | [[贪心算法](../greedy/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy | -| 378 | [有序矩阵中第K小的元素](../../problems/kth-smallest-element-in-a-sorted-matrix) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 378 | [有序矩阵中第K小的元素](../../problems/kth-smallest-element-in-a-sorted-matrix) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 374 | [猜数字大小](../../problems/guess-number-higher-or-lower) | [[二分查找](../binary-search/README.md)] | Easy | | 367 | [有效的完全平方数](../../problems/valid-perfect-square) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 367 | [有效的完全平方数](../../problems/valid-perfect-square) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 363 | [矩形区域不超过 K 的最大数值和](../../problems/max-sum-of-rectangle-no-larger-than-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 363 | [矩形区域不超过 K 的最大数值和](../../problems/max-sum-of-rectangle-no-larger-than-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 354 | [俄罗斯套娃信封问题](../../problems/russian-doll-envelopes) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 352 | [将数据流变为多个不相交区间](../../problems/data-stream-as-disjoint-intervals) | [[二分查找](../binary-search/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 352 | [将数据流变为多个不相交区间](../../problems/data-stream-as-disjoint-intervals) | [[二分查找](../binary-search/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 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 | -| 349 | [两个数组的交集](../../problems/intersection-of-two-arrays) | [[排序](../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 | | 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | -| 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 | | 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 | | 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/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 | | 270 | [最接近的二叉搜索树值](../../problems/closest-binary-search-tree-value) 🔒 | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 270 | [最接近的二叉搜索树值](../../problems/closest-binary-search-tree-value) 🔒 | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 240 | [搜索二维矩阵 II](../../problems/search-a-2d-matrix-ii) | [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium | | 240 | [搜索二维矩阵 II](../../problems/search-a-2d-matrix-ii) | [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Medium | | 230 | [二叉搜索树中第K小的元素](../../problems/kth-smallest-element-in-a-bst) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 230 | [二叉搜索树中第K小的元素](../../problems/kth-smallest-element-in-a-bst) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 222 | [完全二叉树的节点个数](../../problems/count-complete-tree-nodes) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 222 | [完全二叉树的节点个数](../../problems/count-complete-tree-nodes) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 174 | [地下城游戏](../../problems/dungeon-game) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 162 | [寻找峰值](../../problems/find-peak-element) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 162 | [寻找峰值](../../problems/find-peak-element) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 154 | [寻找旋转排序数组中的最小值 II](../../problems/find-minimum-in-rotated-sorted-array-ii) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 154 | [寻找旋转排序数组中的最小值 II](../../problems/find-minimum-in-rotated-sorted-array-ii) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | -| 153 | [寻找旋转排序数组中的最小值](../../problems/find-minimum-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 153 | [寻找旋转排序数组中的最小值](../../problems/find-minimum-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 81 | [搜索旋转排序数组 II](../../problems/search-in-rotated-sorted-array-ii) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 81 | [搜索旋转排序数组 II](../../problems/search-in-rotated-sorted-array-ii) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 74 | [搜索二维矩阵](../../problems/search-a-2d-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 74 | [搜索二维矩阵](../../problems/search-a-2d-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 69 | [x 的平方根](../../problems/sqrtx) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 69 | [x 的平方根](../../problems/sqrtx) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 50 | [Pow(x, n)](../../problems/powx-n) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 50 | [Pow(x, n)](../../problems/powx-n) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 35 | [搜索插入位置](../../problems/search-insert-position) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 35 | [搜索插入位置](../../problems/search-insert-position) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 34 | [在排序数组中查找元素的第一个和最后一个位置](../../problems/find-first-and-last-position-of-element-in-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 34 | [在排序数组中查找元素的第一个和最后一个位置](../../problems/find-first-and-last-position-of-element-in-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 33 | [搜索旋转排序数组](../../problems/search-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 33 | [搜索旋转排序数组](../../problems/search-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 29 | [两数相除](../../problems/divide-two-integers) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 29 | [两数相除](../../problems/divide-two-integers) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 4 | [寻找两个有序数组的中位数](../../problems/median-of-two-sorted-arrays) | [[数组](../array/README.md)] [[二分查找](../binary-search/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 | | 4 | [寻找两个有序数组的中位数](../../problems/median-of-two-sorted-arrays) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard | diff --git a/tag/design/README.md b/tag/design/README.md index c65c5a1b5..0f442f13a 100644 --- a/tag/design/README.md +++ b/tag/design/README.md @@ -11,86 +11,49 @@ | :-: | - | - | :-: | | 1396 | [设计地铁系统](../../problems/design-underground-system) | [[设计](../design/README.md)] | Medium | | 1381 | [设计一个支持增量操作的栈](../../problems/design-a-stack-with-increment-operation) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Medium | -| 1381 | [设计一个支持增量操作的栈](../../problems/design-a-stack-with-increment-operation) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Medium | | 1357 | [每隔 n 个顾客打折](../../problems/apply-discount-every-n-orders) | [[设计](../design/README.md)] | Medium | | 1352 | [最后 K 个数的乘积](../../problems/product-of-the-last-k-numbers) | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | -| 1352 | [最后 K 个数的乘积](../../problems/product-of-the-last-k-numbers) | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | | 1348 | [推文计数](../../problems/tweet-counts-per-frequency) | [[设计](../design/README.md)] | Medium | | 1286 | [字母组合迭代器](../../problems/iterator-for-combination) | [[设计](../design/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | -| 1286 | [字母组合迭代器](../../problems/iterator-for-combination) | [[设计](../design/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | -| 1244 | [力扣排行榜](../../problems/design-a-leaderboard) 🔒 | [[排序](../sort/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 1244 | [力扣排行榜](../../problems/design-a-leaderboard) 🔒 | [[排序](../sort/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 1244 | [力扣排行榜](../../problems/design-a-leaderboard) 🔒 | [[排序](../sort/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 1206 | [设计跳表](../../problems/design-skiplist) | [[设计](../design/README.md)] | Hard | | 1172 | [餐盘栈](../../problems/dinner-plate-stacks) | [[设计](../design/README.md)] | Hard | | 1166 | [设计文件系统](../../problems/design-file-system) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 1166 | [设计文件系统](../../problems/design-file-system) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 716 | [最大栈](../../problems/max-stack) 🔒 | [[设计](../design/README.md)] | Easy | | 707 | [设计链表](../../problems/design-linked-list) | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium | -| 707 | [设计链表](../../problems/design-linked-list) | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium | -| 706 | [设计哈希映射](../../problems/design-hashmap) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | | 706 | [设计哈希映射](../../problems/design-hashmap) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | | 705 | [设计哈希集合](../../problems/design-hashset) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | -| 705 | [设计哈希集合](../../problems/design-hashset) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | -| 642 | [设计搜索自动补全系统](../../problems/design-search-autocomplete-system) 🔒 | [[设计](../design/README.md)] [[字典树](../trie/README.md)] | Hard | | 642 | [设计搜索自动补全系统](../../problems/design-search-autocomplete-system) 🔒 | [[设计](../design/README.md)] [[字典树](../trie/README.md)] | Hard | | 641 | [设计循环双端队列](../../problems/design-circular-deque) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | -| 641 | [设计循环双端队列](../../problems/design-circular-deque) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | -| 635 | [设计日志存储系统](../../problems/design-log-storage-system) 🔒 | [[设计](../design/README.md)] [[字符串](../string/README.md)] | Medium | | 635 | [设计日志存储系统](../../problems/design-log-storage-system) 🔒 | [[设计](../design/README.md)] [[字符串](../string/README.md)] | Medium | | 631 | [设计 Excel 求和公式](../../problems/design-excel-sum-formula) 🔒 | [[设计](../design/README.md)] | Hard | | 622 | [设计循环队列](../../problems/design-circular-queue) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | -| 622 | [设计循环队列](../../problems/design-circular-queue) | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | | 604 | [迭代压缩字符串](../../problems/design-compressed-string-iterator) 🔒 | [[设计](../design/README.md)] | Easy | | 588 | [设计内存文件系统](../../problems/design-in-memory-file-system) 🔒 | [[设计](../design/README.md)] | Hard | | 460 | [LFU缓存](../../problems/lfu-cache) | [[设计](../design/README.md)] | Hard | | 432 | [全 O(1) 的数据结构](../../problems/all-oone-data-structure) | [[设计](../design/README.md)] | Hard | | 381 | [O(1) 时间插入、删除和获取随机元素 - 允许重复](../../problems/insert-delete-getrandom-o1-duplicates-allowed) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Hard | -| 381 | [O(1) 时间插入、删除和获取随机元素 - 允许重复](../../problems/insert-delete-getrandom-o1-duplicates-allowed) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Hard | -| 381 | [O(1) 时间插入、删除和获取随机元素 - 允许重复](../../problems/insert-delete-getrandom-o1-duplicates-allowed) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Hard | -| 380 | [常数时间插入、删除和获取随机元素](../../problems/insert-delete-getrandom-o1) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 380 | [常数时间插入、删除和获取随机元素](../../problems/insert-delete-getrandom-o1) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 380 | [常数时间插入、删除和获取随机元素](../../problems/insert-delete-getrandom-o1) | [[设计](../design/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 379 | [电话目录管理系统](../../problems/design-phone-directory) 🔒 | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium | -| 379 | [电话目录管理系统](../../problems/design-phone-directory) 🔒 | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium | | 362 | [敲击计数器](../../problems/design-hit-counter) 🔒 | [[设计](../design/README.md)] | Medium | | 359 | [日志速率限制器](../../problems/logger-rate-limiter) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | -| 359 | [日志速率限制器](../../problems/logger-rate-limiter) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | | 355 | [设计推特](../../problems/design-twitter) | [[堆](../heap/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 355 | [设计推特](../../problems/design-twitter) | [[堆](../heap/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 355 | [设计推特](../../problems/design-twitter) | [[堆](../heap/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 353 | [贪吃蛇](../../problems/design-snake-game) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | | 353 | [贪吃蛇](../../problems/design-snake-game) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | | 348 | [判定井字棋胜负](../../problems/design-tic-tac-toe) 🔒 | [[设计](../design/README.md)] | Medium | | 346 | [数据流中的移动平均值](../../problems/moving-average-from-data-stream) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Easy | -| 346 | [数据流中的移动平均值](../../problems/moving-average-from-data-stream) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Easy | -| 341 | [扁平化嵌套列表迭代器](../../problems/flatten-nested-list-iterator) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Medium | | 341 | [扁平化嵌套列表迭代器](../../problems/flatten-nested-list-iterator) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Medium | | 297 | [二叉树的序列化与反序列化](../../problems/serialize-and-deserialize-binary-tree) | [[树](../tree/README.md)] [[设计](../design/README.md)] | Hard | -| 297 | [二叉树的序列化与反序列化](../../problems/serialize-and-deserialize-binary-tree) | [[树](../tree/README.md)] [[设计](../design/README.md)] | Hard | -| 295 | [数据流的中位数](../../problems/find-median-from-data-stream) | [[堆](../heap/README.md)] [[设计](../design/README.md)] | Hard | | 295 | [数据流的中位数](../../problems/find-median-from-data-stream) | [[堆](../heap/README.md)] [[设计](../design/README.md)] | Hard | | 288 | [单词的唯一缩写](../../problems/unique-word-abbreviation) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 288 | [单词的唯一缩写](../../problems/unique-word-abbreviation) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 284 | [顶端迭代器](../../problems/peeking-iterator) | [[设计](../design/README.md)] | Medium | | 281 | [锯齿迭代器](../../problems/zigzag-iterator) 🔒 | [[设计](../design/README.md)] | Medium | | 251 | [展开二维向量](../../problems/flatten-2d-vector) 🔒 | [[设计](../design/README.md)] | Medium | | 244 | [最短单词距离 II](../../problems/shortest-word-distance-ii) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | -| 244 | [最短单词距离 II](../../problems/shortest-word-distance-ii) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 232 | [用栈实现队列](../../problems/implement-queue-using-stacks) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | -| 232 | [用栈实现队列](../../problems/implement-queue-using-stacks) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | -| 225 | [用队列实现栈](../../problems/implement-stack-using-queues) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | | 225 | [用队列实现栈](../../problems/implement-stack-using-queues) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | | 211 | [添加与搜索单词 - 数据结构设计](../../problems/add-and-search-word-data-structure-design) | [[设计](../design/README.md)] [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | -| 211 | [添加与搜索单词 - 数据结构设计](../../problems/add-and-search-word-data-structure-design) | [[设计](../design/README.md)] [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | -| 211 | [添加与搜索单词 - 数据结构设计](../../problems/add-and-search-word-data-structure-design) | [[设计](../design/README.md)] [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | -| 208 | [实现 Trie (前缀树)](../../problems/implement-trie-prefix-tree) | [[设计](../design/README.md)] [[字典树](../trie/README.md)] | Medium | | 208 | [实现 Trie (前缀树)](../../problems/implement-trie-prefix-tree) | [[设计](../design/README.md)] [[字典树](../trie/README.md)] | Medium | | 173 | [二叉搜索树迭代器](../../problems/binary-search-tree-iterator) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[设计](../design/README.md)] | Medium | -| 173 | [二叉搜索树迭代器](../../problems/binary-search-tree-iterator) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[设计](../design/README.md)] | Medium | -| 173 | [二叉搜索树迭代器](../../problems/binary-search-tree-iterator) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[设计](../design/README.md)] | Medium | | 170 | [两数之和 III - 数据结构设计](../../problems/two-sum-iii-data-structure-design) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | -| 170 | [两数之和 III - 数据结构设计](../../problems/two-sum-iii-data-structure-design) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | -| 155 | [最小栈](../../problems/min-stack) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | | 155 | [最小栈](../../problems/min-stack) | [[栈](../stack/README.md)] [[设计](../design/README.md)] | Easy | | 146 | [LRU缓存机制](../../problems/lru-cache) | [[设计](../design/README.md)] | Medium | diff --git a/tag/dynamic-programming/README.md b/tag/dynamic-programming/README.md index 6e9b17ce7..213efd277 100644 --- a/tag/dynamic-programming/README.md +++ b/tag/dynamic-programming/README.md @@ -9,7 +9,7 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 5383 | [给 N x 3 网格图涂色的方案数](../../problems/number-of-ways-to-paint-n-x-3-grid) | [[动态规划](../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 | diff --git a/tag/two-pointers/README.md b/tag/two-pointers/README.md index 21c3005e0..a749ae488 100644 --- a/tag/two-pointers/README.md +++ b/tag/two-pointers/README.md @@ -12,120 +12,60 @@ | 1248 | [统计「优美子数组」](../../problems/count-number-of-nice-subarrays) | [[双指针](../two-pointers/README.md)] | Medium | | 1234 | [替换子串得到平衡字符串](../../problems/replace-the-substring-for-balanced-string) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Medium | | 1213 | [三个有序数组的交集](../../problems/intersection-of-three-sorted-arrays) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 1213 | [三个有序数组的交集](../../problems/intersection-of-three-sorted-arrays) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 1093 | [大样本统计](../../problems/statistics-from-a-large-sample) | [[数学](../math/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 1093 | [大样本统计](../../problems/statistics-from-a-large-sample) | [[数学](../math/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 1004 | [最大连续1的个数 III](../../problems/max-consecutive-ones-iii) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1004 | [最大连续1的个数 III](../../problems/max-consecutive-ones-iii) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 992 | [K 个不同整数的子数组](../../problems/subarrays-with-k-different-integers) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | -| 992 | [K 个不同整数的子数组](../../problems/subarrays-with-k-different-integers) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | | 992 | [K 个不同整数的子数组](../../problems/subarrays-with-k-different-integers) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | | 986 | [区间列表的交集](../../problems/interval-list-intersections) | [[双指针](../two-pointers/README.md)] | Medium | | 977 | [有序数组的平方](../../problems/squares-of-a-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 977 | [有序数组的平方](../../problems/squares-of-a-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 930 | [和相同的二元子数组](../../problems/binary-subarrays-with-sum) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 930 | [和相同的二元子数组](../../problems/binary-subarrays-with-sum) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 925 | [长按键入](../../problems/long-pressed-name) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy | | 923 | [三数之和的多种可能](../../problems/3sum-with-multiplicity) | [[双指针](../two-pointers/README.md)] | Medium | | 904 | [水果成篮](../../problems/fruit-into-baskets) | [[双指针](../two-pointers/README.md)] | Medium | | 881 | [救生艇](../../problems/boats-to-save-people) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 881 | [救生艇](../../problems/boats-to-save-people) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 845 | [数组中的最长山脉](../../problems/longest-mountain-in-array) | [[双指针](../two-pointers/README.md)] | Medium | | 844 | [比较含退格的字符串](../../problems/backspace-string-compare) | [[栈](../stack/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 844 | [比较含退格的字符串](../../problems/backspace-string-compare) | [[栈](../stack/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 838 | [推多米诺](../../problems/push-dominoes) | [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | | 838 | [推多米诺](../../problems/push-dominoes) | [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | | 828 | [统计子串中的唯一字符](../../problems/count-unique-characters-of-all-substrings-of-a-given-string) | [[双指针](../two-pointers/README.md)] | Hard | | 826 | [安排工作以达到最大收益](../../problems/most-profit-assigning-work) | [[双指针](../two-pointers/README.md)] | Medium | | 763 | [划分字母区间](../../problems/partition-labels) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 763 | [划分字母区间](../../problems/partition-labels) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 723 | [粉碎糖果](../../problems/candy-crush) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 723 | [粉碎糖果](../../problems/candy-crush) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 713 | [乘积小于K的子数组](../../problems/subarray-product-less-than-k) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 713 | [乘积小于K的子数组](../../problems/subarray-product-less-than-k) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 632 | [最小区间](../../problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard | | 632 | [最小区间](../../problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard | | 567 | [字符串的排列](../../problems/permutation-in-string) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 567 | [字符串的排列](../../problems/permutation-in-string) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | | 532 | [数组中的K-diff数对](../../problems/k-diff-pairs-in-an-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 532 | [数组中的K-diff数对](../../problems/k-diff-pairs-in-an-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 524 | [通过删除字母匹配到字典里最长单词](../../problems/longest-word-in-dictionary-through-deleting) | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 524 | [通过删除字母匹配到字典里最长单词](../../problems/longest-word-in-dictionary-through-deleting) | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 487 | [最大连续1的个数 II](../../problems/max-consecutive-ones-ii) 🔒 | [[双指针](../two-pointers/README.md)] | Medium | | 457 | [环形数组循环](../../problems/circular-array-loop) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 457 | [环形数组循环](../../problems/circular-array-loop) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 424 | [替换后的最长重复字符](../../problems/longest-repeating-character-replacement) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | | 424 | [替换后的最长重复字符](../../problems/longest-repeating-character-replacement) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | | 360 | [有序转化数组](../../problems/sort-transformed-array) 🔒 | [[数学](../math/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 360 | [有序转化数组](../../problems/sort-transformed-array) 🔒 | [[数学](../math/README.md)] [[双指针](../two-pointers/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 | -| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 350 | [两个数组的交集 II](../../problems/intersection-of-two-arrays-ii) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 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 | -| 349 | [两个数组的交集](../../problems/intersection-of-two-arrays) | [[排序](../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 | -| 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 | | 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 287 | [寻找重复数](../../problems/find-the-duplicate-number) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/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 | | 283 | [移动零](../../problems/move-zeroes) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | | 259 | [较小的三数之和](../../problems/3sum-smaller) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 259 | [较小的三数之和](../../problems/3sum-smaller) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 234 | [回文链表](../../problems/palindrome-linked-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 234 | [回文链表](../../problems/palindrome-linked-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | | 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 167 | [两数之和 II - 输入有序数组](../../problems/two-sum-ii-input-array-is-sorted) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Easy | -| 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 | | 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 | -| 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 | -| 142 | [环形链表 II](../../problems/linked-list-cycle-ii) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/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 | -| 141 | [环形链表](../../problems/linked-list-cycle) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Easy | | 125 | [验证回文串](../../problems/valid-palindrome) | [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Easy | | 88 | [合并两个有序数组](../../problems/merge-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 88 | [合并两个有序数组](../../problems/merge-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | | 86 | [分隔链表](../../problems/partition-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 86 | [分隔链表](../../problems/partition-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 80 | [删除排序数组中的重复项 II](../../problems/remove-duplicates-from-sorted-array-ii) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 80 | [删除排序数组中的重复项 II](../../problems/remove-duplicates-from-sorted-array-ii) | [[数组](../array/README.md)] [[双指针](../two-pointers/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 | -| 76 | [最小覆盖子串](../../problems/minimum-window-substring) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/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 | -| 75 | [颜色分类](../../problems/sort-colors) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 75 | [颜色分类](../../problems/sort-colors) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 75 | [颜色分类](../../problems/sort-colors) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 61 | [旋转链表](../../problems/rotate-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 61 | [旋转链表](../../problems/rotate-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Hard | -| 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Hard | -| 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Hard | -| 30 | [串联所有单词的子串](../../problems/substring-with-concatenation-of-all-words) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/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 | | 27 | [移除元素](../../problems/remove-element) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 27 | [移除元素](../../problems/remove-element) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | | 26 | [删除排序数组中的重复项](../../problems/remove-duplicates-from-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 26 | [删除排序数组中的重复项](../../problems/remove-duplicates-from-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | -| 19 | [删除链表的倒数第N个节点](../../problems/remove-nth-node-from-end-of-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 19 | [删除链表的倒数第N个节点](../../problems/remove-nth-node-from-end-of-list) | [[链表](../linked-list/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 18 | [四数之和](../../problems/4sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 18 | [四数之和](../../problems/4sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 18 | [四数之和](../../problems/4sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 16 | [最接近的三数之和](../../problems/3sum-closest) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 16 | [最接近的三数之和](../../problems/3sum-closest) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 15 | [三数之和](../../problems/3sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 15 | [三数之和](../../problems/3sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 11 | [盛最多水的容器](../../problems/container-with-most-water) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | -| 11 | [盛最多水的容器](../../problems/container-with-most-water) | [[数组](../array/README.md)] [[双指针](../two-pointers/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 | -| 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 | | 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 |