From 18de5fd02df283af813c7b10af8e4faf5bf8b752 Mon Sep 17 00:00:00 2001 From: Shuo Date: Wed, 24 Feb 2021 16:22:12 +0800 Subject: [PATCH 1/3] A: new --- README.md | 24 ++ problems/best-sightseeing-pair/README.md | 31 ++- .../README.md | 25 +- .../README.md | 46 ++-- .../README.md | 46 ++-- .../binary-tree-right-side-view/README.md | 40 ++- .../README.md | 44 ++-- problems/break-a-palindrome/README.md | 22 +- .../buildings-with-an-ocean-view/README.md | 28 ++ problems/candy/README.md | 20 +- .../README.md | 80 ++++++ problems/closest-subsequence-sum/README.md | 79 ++++++ .../README.md | 37 ++- .../README.md | 38 ++- .../README.md | 35 ++- .../README.md | 71 +++++ .../mysql_schemas.sql | 2 +- problems/decode-ways-ii/README.md | 2 +- problems/design-an-ordered-stream/README.md | 4 +- .../design-most-recently-used-queue/README.md | 34 +++ problems/design-tic-tac-toe/README.md | 2 +- problems/distinct-subsequences/README.md | 6 +- problems/equal-rational-numbers/README.md | 69 ++--- .../README.md | 2 +- .../README.md | 12 +- .../README.md | 14 + .../mysql_schemas.sql | 12 + .../README.md | 20 +- .../README.md | 74 ++++++ problems/is-graph-bipartite/README.md | 44 ++-- .../README.md | 4 +- .../largest-merge-of-two-strings/README.md | 85 ++++++ problems/leetflex-banned-accounts/README.md | 2 +- problems/longest-nice-substring/README.md | 65 +++++ .../README.md | 38 +-- problems/map-of-highest-peak/README.md | 80 ++++++ problems/max-consecutive-ones/README.md | 2 +- .../README.md | 70 +++++ .../README.md | 72 +++++ .../README.md | 72 +++++ .../README.md | 80 ++++++ .../README.md | 79 ++++++ problems/merge-strings-alternately/README.md | 67 +++++ .../README.md | 71 +++++ .../README.md | 66 +++++ .../README.md | 76 ++++++ .../minimum-limit-of-balls-in-a-bag/README.md | 83 ++++++ .../README.md | 67 +++++ .../README.md | 2 +- problems/number-of-1-bits/README.md | 9 +- problems/number-of-enclaves/README.md | 43 ++- problems/pascals-triangle-ii/README.md | 18 +- problems/pascals-triangle/README.md | 34 +-- problems/path-sum-iv/README.md | 2 +- problems/peeking-iterator/README.md | 44 +++- .../README.md | 2 +- .../recyclable-and-low-fat-products/README.md | 14 + .../mysql_schemas.sql | 7 + problems/relative-ranks/README.md | 50 +++- problems/repeated-substring-pattern/README.md | 33 ++- problems/restore-ip-addresses/README.md | 2 +- problems/reverse-linked-list-ii/README.md | 29 ++- problems/reverse-linked-list/README.md | 34 ++- problems/roman-to-integer/README.md | 16 +- .../README.md | 8 +- .../search-in-rotated-sorted-array/README.md | 9 +- .../README.md | 24 +- .../shortest-path-in-binary-matrix/README.md | 51 ++-- .../README.md | 30 +-- problems/sum-of-unique-elements/README.md | 59 +++++ problems/sum-root-to-leaf-numbers/README.md | 44 ++-- problems/surrounded-regions/README.md | 34 +-- problems/swap-salary/README.md | 39 ++- problems/symmetric-tree/README.md | 36 +-- .../the-k-weakest-rows-in-a-matrix/README.md | 47 ++-- problems/transpose-matrix/README.md | 36 ++- problems/tree-of-coprimes/README.md | 78 ++++++ problems/valid-palindrome/README.md | 12 +- problems/valid-parenthesis-string/README.md | 62 ++--- problems/validate-binary-tree-nodes/README.md | 22 +- problems/word-ladder-ii/README.md | 54 ++-- readme/1-300.md | 6 +- readme/301-600.md | 8 +- readme/601-900.md | 6 +- tag/README.md | 3 +- tag/backtracking/README.md | 66 +++++ tag/binary-search/README.md | 6 +- tag/bit-manipulation/README.md | 2 +- tag/breadth-first-search/README.md | 6 +- tag/depth-first-search/README.md | 155 +++++++++++ tag/design/README.md | 3 +- tag/divide-and-conquer/README.md | 1 + tag/dynamic-programming/README.md | 245 ------------------ tag/geometry/README.md | 9 - tag/graph/README.md | 53 ++++ tag/greedy/README.md | 7 + tag/hash-table/README.md | 140 ++++++++++ tag/heap/README.md | 4 +- tag/line-sweep/README.md | 6 - tag/linked-list/README.md | 43 --- tag/math/README.md | 200 ++++++++++++++ tag/meet-in-the-middle/README.md | 11 + tag/ordered-map/README.md | 14 - tag/queue/README.md | 1 + tag/recursion/README.md | 1 + tag/segment-tree/README.md | 16 ++ tag/sliding-window/README.md | 27 -- tag/sort/README.md | 75 ------ tag/string/README.md | 219 ++++++++++++++++ tag/tags.json | 5 + tag/tree/README.md | 7 +- tag/two-pointers/README.md | 1 + 112 files changed, 3334 insertions(+), 1038 deletions(-) create mode 100644 problems/buildings-with-an-ocean-view/README.md create mode 100644 problems/check-if-array-is-sorted-and-rotated/README.md create mode 100644 problems/closest-subsequence-sum/README.md create mode 100644 problems/count-number-of-homogenous-substrings/README.md create mode 100644 problems/design-most-recently-used-queue/README.md create mode 100644 problems/find-the-subtasks-that-did-not-execute/README.md create mode 100644 problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql create mode 100644 problems/form-array-by-concatenating-subarrays-of-another-array/README.md create mode 100644 problems/largest-merge-of-two-strings/README.md create mode 100644 problems/longest-nice-substring/README.md create mode 100644 problems/map-of-highest-peak/README.md create mode 100644 problems/maximize-palindrome-length-from-subsequences/README.md create mode 100644 problems/maximum-absolute-sum-of-any-subarray/README.md create mode 100644 problems/maximum-number-of-events-that-can-be-attended-ii/README.md create mode 100644 problems/maximum-score-from-performing-multiplication-operations/README.md create mode 100644 problems/maximum-score-from-removing-stones/README.md create mode 100644 problems/merge-strings-alternately/README.md create mode 100644 problems/minimum-changes-to-make-alternating-binary-string/README.md create mode 100644 problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md create mode 100644 problems/minimum-length-of-string-after-deleting-similar-ends/README.md create mode 100644 problems/minimum-limit-of-balls-in-a-bag/README.md create mode 100644 problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md create mode 100644 problems/recyclable-and-low-fat-products/README.md create mode 100644 problems/recyclable-and-low-fat-products/mysql_schemas.sql create mode 100644 problems/sum-of-unique-elements/README.md create mode 100644 problems/tree-of-coprimes/README.md create mode 100644 tag/meet-in-the-middle/README.md diff --git a/README.md b/README.md index fb78fb408..729abf1fb 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,30 @@ LeetCode Problems' Solutions | # | Title | Solution | Difficulty | | :-: | - | - | :-: | +| 1771 | [Maximize Palindrome Length From Subsequences](https://leetcode.com/problems/maximize-palindrome-length-from-subsequences "由子序列构造的最长回文串的长度") | [Go](problems/maximize-palindrome-length-from-subsequences) | Hard | +| 1770 | [Maximum Score from Performing Multiplication Operations](https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations "执行乘法运算的最大分数") | [Go](problems/maximum-score-from-performing-multiplication-operations) | Medium | +| 1769 | [Minimum Number of Operations to Move All Balls to Each Box](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box "移动所有球到每个盒子所需的最小操作数") | [Go](problems/minimum-number-of-operations-to-move-all-balls-to-each-box) | Medium | +| 1768 | [Merge Strings Alternately](https://leetcode.com/problems/merge-strings-alternately "交替合并字符串") | [Go](problems/merge-strings-alternately) | Easy | +| 1767 | [Find the Subtasks That Did Not Execute](https://leetcode.com/problems/find-the-subtasks-that-did-not-execute) 🔒 | [MySQL](problems/find-the-subtasks-that-did-not-execute) | Hard | +| 1766 | [Tree of Coprimes](https://leetcode.com/problems/tree-of-coprimes "互质树") | [Go](problems/tree-of-coprimes) | Hard | +| 1765 | [Map of Highest Peak](https://leetcode.com/problems/map-of-highest-peak "地图中的最高点") | [Go](problems/map-of-highest-peak) | Medium | +| 1764 | [Form Array by Concatenating Subarrays of Another Array](https://leetcode.com/problems/form-array-by-concatenating-subarrays-of-another-array "通过连接另一个数组的子数组得到一个数组") | [Go](problems/form-array-by-concatenating-subarrays-of-another-array) | Medium | +| 1763 | [Longest Nice Substring](https://leetcode.com/problems/longest-nice-substring "最长的美好子字符串") | [Go](problems/longest-nice-substring) | Easy | +| 1762 | [Buildings With an Ocean View](https://leetcode.com/problems/buildings-with-an-ocean-view) 🔒 | [Go](problems/buildings-with-an-ocean-view) | Medium | +| 1761 | [Minimum Degree of a Connected Trio in a Graph](https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph "一个图中连通三元组的最小度数") | [Go](problems/minimum-degree-of-a-connected-trio-in-a-graph) | Hard | +| 1760 | [Minimum Limit of Balls in a Bag](https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag "袋子里最少数目的球") | [Go](problems/minimum-limit-of-balls-in-a-bag) | Medium | +| 1759 | [Count Number of Homogenous Substrings](https://leetcode.com/problems/count-number-of-homogenous-substrings "统计同构子字符串的数目") | [Go](problems/count-number-of-homogenous-substrings) | Medium | +| 1758 | [Minimum Changes To Make Alternating Binary String](https://leetcode.com/problems/minimum-changes-to-make-alternating-binary-string "生成交替二进制字符串的最少操作数") | [Go](problems/minimum-changes-to-make-alternating-binary-string) | Easy | +| 1757 | [Recyclable and Low Fat Products](https://leetcode.com/problems/recyclable-and-low-fat-products) 🔒 | [MySQL](problems/recyclable-and-low-fat-products) | Easy | +| 1756 | [Design Most Recently Used Queue](https://leetcode.com/problems/design-most-recently-used-queue) 🔒 | [Go](problems/design-most-recently-used-queue) | Medium | +| 1755 | [Closest Subsequence Sum](https://leetcode.com/problems/closest-subsequence-sum "最接近目标值的子序列和") | [Go](problems/closest-subsequence-sum) | Hard | +| 1754 | [Largest Merge Of Two Strings](https://leetcode.com/problems/largest-merge-of-two-strings "构造字典序最大的合并字符串") | [Go](problems/largest-merge-of-two-strings) | Medium | +| 1753 | [Maximum Score From Removing Stones](https://leetcode.com/problems/maximum-score-from-removing-stones "移除石子的最大得分") | [Go](problems/maximum-score-from-removing-stones) | Medium | +| 1752 | [Check if Array Is Sorted and Rotated](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated "检查数组是否经排序和轮转得到") | [Go](problems/check-if-array-is-sorted-and-rotated) | Easy | +| 1751 | [Maximum Number of Events That Can Be Attended II](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii "最多可以参加的会议数目 II") | [Go](problems/maximum-number-of-events-that-can-be-attended-ii) | Hard | +| 1750 | [Minimum Length of String After Deleting Similar Ends](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends "删除字符串两端相同字符后的最短长度") | [Go](problems/minimum-length-of-string-after-deleting-similar-ends) | Medium | +| 1749 | [Maximum Absolute Sum of Any Subarray](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray "任意子数组和的绝对值的最大值") | [Go](problems/maximum-absolute-sum-of-any-subarray) | Medium | +| 1748 | [Sum of Unique Elements](https://leetcode.com/problems/sum-of-unique-elements "唯一元素的和") | [Go](problems/sum-of-unique-elements) | Easy | | 1747 | [Leetflex Banned Accounts](https://leetcode.com/problems/leetflex-banned-accounts) 🔒 | [MySQL](problems/leetflex-banned-accounts) | Medium | | 1746 | [Maximum Subarray Sum After One Operation](https://leetcode.com/problems/maximum-subarray-sum-after-one-operation) 🔒 | [Go](problems/maximum-subarray-sum-after-one-operation) | Medium | | 1745 | [Palindrome Partitioning IV](https://leetcode.com/problems/palindrome-partitioning-iv "回文串分割 IV") | [Go](problems/palindrome-partitioning-iv) | Hard | diff --git a/problems/best-sightseeing-pair/README.md b/problems/best-sightseeing-pair/README.md index 73535759b..25ba93e5d 100644 --- a/problems/best-sightseeing-pair/README.md +++ b/problems/best-sightseeing-pair/README.md @@ -11,30 +11,35 @@ ## [1014. Best Sightseeing Pair (Medium)](https://leetcode.com/problems/best-sightseeing-pair "最佳观光组合") -

Given an array A of positive integers, A[i] represents the value of the i-th sightseeing spot, and two sightseeing spots i and j have distance j - i between them.

+

You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them.

-

The score of a pair (i < j) of sightseeing spots is (A[i] + A[j] + i - j) : the sum of the values of the sightseeing spots, minus the distance between them.

+

The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the values of the sightseeing spots, minus the distance between them.

-

Return the maximum score of a pair of sightseeing spots.

+

Return the maximum score of a pair of sightseeing spots.

 

-

Example 1:

-Input: [8,1,5,2,6]
-Output: 11
-Explanation: i = 0, j = 2, A[i] + A[j] + i - j = 8 + 5 + 0 - 2 = 11
+Input: values = [8,1,5,2,6]
+Output: 11
+Explanation: i = 0, j = 2, values[i] + values[j] + i - j = 8 + 5 + 0 - 2 = 11
 
-

 

+

Example 2:

+ +
+Input: values = [1,2]
+Output: 2
+
-

Note:

+

 

+

Constraints:

-
    -
  1. 2 <= A.length <= 50000
  2. -
  3. 1 <= A[i] <= 1000
  4. -
+ ### Related Topics [[Array](../../tag/array/README.md)] diff --git a/problems/best-time-to-buy-and-sell-stock-ii/README.md b/problems/best-time-to-buy-and-sell-stock-ii/README.md index ab394120d..94814f1bc 100644 --- a/problems/best-time-to-buy-and-sell-stock-ii/README.md +++ b/problems/best-time-to-buy-and-sell-stock-ii/README.md @@ -11,44 +11,45 @@ ## [122. Best Time to Buy and Sell Stock II (Easy)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii "买卖股票的最佳时机 II") -

Say you have an array prices for which the ith element is the price of a given stock on day i.

+

You are given an array prices for which the ith element is the price of a given stock on day i.

-

Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).

+

Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).

-

Note: You may not engage in multiple transactions at the same time (i.e., you must sell the stock before you buy again).

+

Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

+

 

Example 1:

-Input: [7,1,5,3,6,4]
+Input: prices = [7,1,5,3,6,4]
 Output: 7
 Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.
-             Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
+Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
 

Example 2:

-Input: [1,2,3,4,5]
+Input: prices = [1,2,3,4,5]
 Output: 4
 Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
-             Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are
-             engaging multiple transactions at the same time. You must sell before buying again.
+Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are engaging multiple transactions at the same time. You must sell before buying again.
 

Example 3:

-Input: [7,6,4,3,1]
+Input: prices = [7,6,4,3,1]
 Output: 0
-Explanation: In this case, no transaction is done, i.e. max profit = 0.
+Explanation: In this case, no transaction is done, i.e., max profit = 0. +

 

Constraints:

### 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 979c5576a..8affa67ef 100644 --- a/problems/binary-tree-level-order-traversal-ii/README.md +++ b/problems/binary-tree-level-order-traversal-ii/README.md @@ -9,31 +9,39 @@                  [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 (Medium)](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).

+

Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).

-

-For example:
-Given binary tree [3,9,20,null,null,15,7],
+

 

+

Example 1:

+
-    3
-   / \
-  9  20
-    /  \
-   15   7
+Input: root = [3,9,20,null,null,15,7]
+Output: [[15,7],[9,20],[3]]
 
-

-

-return its bottom-up level order traversal as:
+ +

Example 2:

+ +
+Input: root = [1]
+Output: [[1]]
+
+ +

Example 3:

+
-[
-  [15,7],
-  [9,20],
-  [3]
-]
+Input: root = []
+Output: []
 
-

+ +

 

+

Constraints:

+ + ### Related Topics [[Tree](../../tag/tree/README.md)] diff --git a/problems/binary-tree-level-order-traversal/README.md b/problems/binary-tree-level-order-traversal/README.md index 31c4ec7a1..14a022f14 100644 --- a/problems/binary-tree-level-order-traversal/README.md +++ b/problems/binary-tree-level-order-traversal/README.md @@ -11,29 +11,37 @@ ## [102. Binary Tree Level Order Traversal (Medium)](https://leetcode.com/problems/binary-tree-level-order-traversal "二叉树的层序遍历") -

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).

+

Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

-

-For example:
-Given binary tree [3,9,20,null,null,15,7],
+

 

+

Example 1:

+
-    3
-   / \
-  9  20
-    /  \
-   15   7
+Input: root = [3,9,20,null,null,15,7]
+Output: [[3],[9,20],[15,7]]
 
-

-

-return its level order traversal as:
+ +

Example 2:

+ +
+Input: root = [1]
+Output: [[1]]
+
+ +

Example 3:

+
-[
-  [3],
-  [9,20],
-  [15,7]
-]
+Input: root = []
+Output: []
 
-

+ +

 

+

Constraints:

+ + ### Related Topics [[Tree](../../tag/tree/README.md)] @@ -41,7 +49,7 @@ return its level order traversal as:
### Similar Questions 1. [Binary Tree Zigzag Level Order Traversal](../binary-tree-zigzag-level-order-traversal) (Medium) - 1. [Binary Tree Level Order Traversal II](../binary-tree-level-order-traversal-ii) (Easy) + 1. [Binary Tree Level Order Traversal II](../binary-tree-level-order-traversal-ii) (Medium) 1. [Minimum Depth of Binary Tree](../minimum-depth-of-binary-tree) (Easy) 1. [Binary Tree Vertical Order Traversal](../binary-tree-vertical-order-traversal) (Medium) 1. [Average of Levels in Binary Tree](../average-of-levels-in-binary-tree) (Easy) diff --git a/problems/binary-tree-right-side-view/README.md b/problems/binary-tree-right-side-view/README.md index c4c1c1725..22244fcf6 100644 --- a/problems/binary-tree-right-side-view/README.md +++ b/problems/binary-tree-right-side-view/README.md @@ -11,26 +11,44 @@ ## [199. Binary Tree Right Side View (Medium)](https://leetcode.com/problems/binary-tree-right-side-view "二叉树的右视图") -

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.

+

Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.

-

Example:

+

 

+

Example 1:

+ +
+Input: root = [1,2,3,null,5,null,4]
+Output: [1,3,4]
+
+ +

Example 2:

-Input: [1,2,3,null,5,null,4]
-Output: [1, 3, 4]
-Explanation:
-
-   1            <---
- /   \
-2     3         <---
- \     \
-  5     4       <---
+Input: root = [1,null,3]
+Output: [1,3]
 
+

Example 3:

+ +
+Input: root = []
+Output: []
+
+ +

 

+

Constraints:

+ + + ### Related Topics [[Tree](../../tag/tree/README.md)] [[Depth-first Search](../../tag/depth-first-search/README.md)] [[Breadth-first Search](../../tag/breadth-first-search/README.md)] + [[Recursion](../../tag/recursion/README.md)] + [[Queue](../../tag/queue/README.md)] ### Similar Questions 1. [Populating Next Right Pointers in Each Node](../populating-next-right-pointers-in-each-node) (Medium) diff --git a/problems/binary-tree-zigzag-level-order-traversal/README.md b/problems/binary-tree-zigzag-level-order-traversal/README.md index 16ffa8bda..fee5e1949 100644 --- a/problems/binary-tree-zigzag-level-order-traversal/README.md +++ b/problems/binary-tree-zigzag-level-order-traversal/README.md @@ -11,29 +11,37 @@ ## [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).

+

Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).

-

-For example:
-Given binary tree [3,9,20,null,null,15,7],
+

 

+

Example 1:

+
-    3
-   / \
-  9  20
-    /  \
-   15   7
+Input: root = [3,9,20,null,null,15,7]
+Output: [[3],[20,9],[15,7]]
 
-

-

-return its zigzag level order traversal as:
+ +

Example 2:

+ +
+Input: root = [1]
+Output: [[1]]
+
+ +

Example 3:

+
-[
-  [3],
-  [20,9],
-  [15,7]
-]
+Input: root = []
+Output: []
 
-

+ +

 

+

Constraints:

+ + ### Related Topics [[Stack](../../tag/stack/README.md)] diff --git a/problems/break-a-palindrome/README.md b/problems/break-a-palindrome/README.md index bf8c6aaac..062474487 100644 --- a/problems/break-a-palindrome/README.md +++ b/problems/break-a-palindrome/README.md @@ -11,9 +11,11 @@ ## [1328. Break a Palindrome (Medium)](https://leetcode.com/problems/break-a-palindrome "破坏回文串") -

Given a palindromic string palindrome, replace exactly one character with any lowercase English letter so that the string becomes the lexicographically smallest possible string that is not a palindrome.

+

Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible.

-

After doing so, return the final string. If there is no way to do so, return an empty string.

+

Return the resulting string. If there is no way to replace a character to make it not a palindrome, return an empty string.

+ +

A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, a has a character strictly smaller than the corresponding character in b. For example, "abcc" is lexicographically smaller than "abcd" because the first position they differ is at the fourth character, and 'c' is smaller than 'd'.

 

Example 1:

@@ -21,6 +23,8 @@
 Input: palindrome = "abccba"
 Output: "aaccba"
+Explanation: There are many ways to make "abccba" not a palindrome, such as "zbccba", "aaccba", and "abacba".
+Of all the ways, "aaccba" is the lexicographically smallest.
 

Example 2:

@@ -28,6 +32,20 @@
 Input: palindrome = "a"
 Output: ""
+Explanation: There is no way to replace a single character to make "a" not a palindrome, so return an empty string.
+
+ +

Example 3:

+ +
+Input: palindrome = "aa"
+Output: "ab"
+ +

Example 4:

+ +
+Input: palindrome = "aba"
+Output: "abb"
 

 

diff --git a/problems/buildings-with-an-ocean-view/README.md b/problems/buildings-with-an-ocean-view/README.md new file mode 100644 index 000000000..6eaec32b0 --- /dev/null +++ b/problems/buildings-with-an-ocean-view/README.md @@ -0,0 +1,28 @@ + + + + + + + +[< Previous](../minimum-degree-of-a-connected-trio-in-a-graph "Minimum Degree of a Connected Trio in a Graph") +                 +[Next >](../longest-nice-substring "Longest Nice Substring") + +## [1762. Buildings With an Ocean View (Medium)](https://leetcode.com/problems/buildings-with-an-ocean-view "") + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + +### Hints +
+Hint 1 +You can traverse the buildings from the nearest to the ocean to the furthest. +
+ +
+Hint 2 +Keep with you the maximum to the right while traversing to determine if you can see the ocean or not. +
diff --git a/problems/candy/README.md b/problems/candy/README.md index 4254bd489..5edb3f3c1 100644 --- a/problems/candy/README.md +++ b/problems/candy/README.md @@ -11,7 +11,7 @@ ## [135. Candy (Hard)](https://leetcode.com/problems/candy "分发糖果") -

There are N children standing in a line. Each child is assigned a rating value.

+

There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.

You are giving candies to these children subjected to the following requirements:

@@ -20,12 +20,13 @@
  • Children with a higher rating get more candies than their neighbors.
  • -

    What is the minimum candies you must give?

    +

    Return the minimum number of candies you need to have to distribute the candies to the children.

    +

     

    Example 1:

    -Input: [1,0,2]
    +Input: ratings = [1,0,2]
     Output: 5
     Explanation: You can allocate to the first, second and third child with 2, 1, 2 candies respectively.
     
    @@ -33,11 +34,20 @@

    Example 2:

    -Input: [1,2,2]
    +Input: ratings = [1,2,2]
     Output: 4
     Explanation: You can allocate to the first, second and third child with 1, 2, 1 candies respectively.
    -             The third child gets 1 candy because it satisfies the above two conditions.
    +The third child gets 1 candy because it satisfies the above two conditions.
     
    +

     

    +

    Constraints:

    + + + ### Related Topics [[Greedy](../../tag/greedy/README.md)] diff --git a/problems/check-if-array-is-sorted-and-rotated/README.md b/problems/check-if-array-is-sorted-and-rotated/README.md new file mode 100644 index 000000000..cf7fd74e0 --- /dev/null +++ b/problems/check-if-array-is-sorted-and-rotated/README.md @@ -0,0 +1,80 @@ + + + + + + + +[< Previous](../maximum-number-of-events-that-can-be-attended-ii "Maximum Number of Events That Can Be Attended II") +                 +[Next >](../maximum-score-from-removing-stones "Maximum Score From Removing Stones") + +## [1752. Check if Array Is Sorted and Rotated (Easy)](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated "检查数组是否经排序和轮转得到") + +

    Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.

    + +

    There may be duplicates in the original array.

    + +

    Note: An array A rotated by x positions results in an array B of the same length such that A[i] == B[(i+x) % A.length], where % is the modulo operation.

    + +

     

    +

    Example 1:

    + +
    +Input: nums = [3,4,5,1,2]
    +Output: true
    +Explanation: [1,2,3,4,5] is the original sorted array.
    +You can rotate the array by x = 3 positions to begin on the the element of value 3: [3,4,5,1,2].
    +
    + +

    Example 2:

    + +
    +Input: nums = [2,1,3,4]
    +Output: false
    +Explanation: There is no sorted array once rotated that can make nums.
    +
    + +

    Example 3:

    + +
    +Input: nums = [1,2,3]
    +Output: true
    +Explanation: [1,2,3] is the original sorted array.
    +You can rotate the array by x = 0 positions (i.e. no rotation) to make nums.
    +
    + +

    Example 4:

    + +
    +Input: nums = [1,1,1]
    +Output: true
    +Explanation: [1,1,1] is the original sorted array.
    +You can rotate any number of positions to make nums.
    +
    + +

    Example 5:

    + +
    +Input: nums = [2,1]
    +Output: true
    +Explanation: [1,2] is the original sorted array.
    +You can rotate the array by x = 5 positions to begin on the element of value 2: [2,1].
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Array](../../tag/array/README.md)] + +### Hints +
    +Hint 1 +Brute force and check if it is possible for a sorted array to start from each position. +
    diff --git a/problems/closest-subsequence-sum/README.md b/problems/closest-subsequence-sum/README.md new file mode 100644 index 000000000..5ba810908 --- /dev/null +++ b/problems/closest-subsequence-sum/README.md @@ -0,0 +1,79 @@ + + + + + + + +[< Previous](../largest-merge-of-two-strings "Largest Merge Of Two Strings") +                 +[Next >](../design-most-recently-used-queue "Design Most Recently Used Queue") + +## [1755. Closest Subsequence Sum (Hard)](https://leetcode.com/problems/closest-subsequence-sum "最接近目标值的子序列和") + +

    You are given an integer array nums and an integer goal.

    + +

    You want to choose a subsequence of nums such that the sum of its elements is the closest possible to goal. That is, if the sum of the subsequence's elements is sum, then you want to minimize the absolute difference abs(sum - goal).

    + +

    Return the minimum possible value of abs(sum - goal).

    + +

    Note that a subsequence of an array is an array formed by removing some elements (possibly all or none) of the original array.

    + +

     

    +

    Example 1:

    + +
    +Input: nums = [5,-7,3,5], goal = 6
    +Output: 0
    +Explanation: Choose the whole array as a subsequence, with a sum of 6.
    +This is equal to the goal, so the absolute difference is 0.
    +
    + +

    Example 2:

    + +
    +Input: nums = [7,-9,15,-2], goal = -5
    +Output: 1
    +Explanation: Choose the subsequence [7,-9,-2], with a sum of -4.
    +The absolute difference is abs(-4 - (-5)) = abs(1) = 1, which is the minimum.
    +
    + +

    Example 3:

    + +
    +Input: nums = [1,2,3], goal = -7
    +Output: 7
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Divide and Conquer](../../tag/divide-and-conquer/README.md)] + +### Hints +
    +Hint 1 +The naive solution is to check all possible subsequences. This works in O(2^n). +
    + +
    +Hint 2 +Divide the array into two parts of nearly is equal size. +
    + +
    +Hint 3 +Consider all subsets of one part and make a list of all possible subset sums and sort this list. +
    + +
    +Hint 4 +Consider all subsets of the other part, and for each one, let its sum = x, do binary search to get the nearest possible value to goal - x in the first part. +
    diff --git a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md b/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md index 6cab3faca..e4383d3bb 100644 --- a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md +++ b/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md @@ -11,27 +11,36 @@ ## [106. Construct Binary Tree from Inorder and Postorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal "从中序与后序遍历序列构造二叉树") -

    Given inorder and postorder traversal of a tree, construct the binary tree.

    - -

    Note:
    -You may assume that duplicates do not exist in the tree.

    - -

    For example, given

    +

    Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.

    +

     

    +

    Example 1:

    +
    -inorder = [9,3,15,20,7]
    -postorder = [9,15,7,20,3]
    +Input: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3] +Output: [3,9,20,null,null,15,7] + -

    Return the following binary tree:

    +

    Example 2:

    -    3
    -   / \
    -  9  20
    -    /  \
    -   15   7
    +Input: inorder = [-1], postorder = [-1]
    +Output: []
     
    +

     

    +

    Constraints:

    + + + ### Related Topics [[Tree](../../tag/tree/README.md)] [[Depth-first Search](../../tag/depth-first-search/README.md)] diff --git a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md b/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md index b90901203..8e1ffa01e 100644 --- a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md +++ b/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md @@ -11,25 +11,35 @@ ## [105. Construct Binary Tree from Preorder and Inorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal "从前序与中序遍历序列构造二叉树") -

    Given preorder and inorder traversal of a tree, construct the binary tree.

    - -

    Note:
    -You may assume that duplicates do not exist in the tree.

    - -

    For example, given

    +

    Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.

    +

     

    +

    Example 1:

    +
    -preorder = [3,9,20,15,7]
    -inorder = [9,3,15,20,7]
    +Input: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7] +Output: [3,9,20,null,null,15,7] + -

    Return the following binary tree:

    +

    Example 2:

    -    3
    -   / \
    -  9  20
    -    /  \
    -   15   7
    +Input: preorder = [-1], inorder = [-1] +Output: [-1] + + +

     

    +

    Constraints:

    + + ### Related Topics [[Tree](../../tag/tree/README.md)] diff --git a/problems/convert-sorted-array-to-binary-search-tree/README.md b/problems/convert-sorted-array-to-binary-search-tree/README.md index 7b9ec6396..2fe1439c5 100644 --- a/problems/convert-sorted-array-to-binary-search-tree/README.md +++ b/problems/convert-sorted-array-to-binary-search-tree/README.md @@ -11,23 +11,36 @@ ## [108. Convert Sorted Array to Binary Search Tree (Easy)](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree "将有序数组转换为二叉搜索树") -

    Given an array where elements are sorted in ascending order, convert it to a height balanced BST.

    +

    Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.

    -

    For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.

    +

    A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.

    -

    Example:

    +

     

    +

    Example 1:

    + +
    +Input: nums = [-10,-3,0,5,9]
    +Output: [0,-3,9,-10,null,5]
    +Explanation: [0,-10,5,null,-3,null,9] is also accepted:
    +
    +
    +

    Example 2:

    +
    -Given the sorted array: [-10,-3,0,5,9],
    +Input: nums = [1,3]
    +Output: [3,1]
    +Explanation: [1,3] and [3,1] are both a height-balanced BSTs.
    +
    -One possible answer is: [0,-3,9,-10,null,5], which represents the following height balanced BST: +

     

    +

    Constraints:

    - 0 - / \ - -3 9 - / / - -10 5 - + ### Related Topics [[Tree](../../tag/tree/README.md)] diff --git a/problems/count-number-of-homogenous-substrings/README.md b/problems/count-number-of-homogenous-substrings/README.md new file mode 100644 index 000000000..517f518d7 --- /dev/null +++ b/problems/count-number-of-homogenous-substrings/README.md @@ -0,0 +1,71 @@ + + + + + + + +[< Previous](../minimum-changes-to-make-alternating-binary-string "Minimum Changes To Make Alternating Binary String") +                 +[Next >](../minimum-limit-of-balls-in-a-bag "Minimum Limit of Balls in a Bag") + +## [1759. Count Number of Homogenous Substrings (Medium)](https://leetcode.com/problems/count-number-of-homogenous-substrings "统计同构子字符串的数目") + +

    Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo 109 + 7.

    + +

    A string is homogenous if all the characters of the string are the same.

    + +

    A substring is a contiguous sequence of characters within a string.

    + +

     

    +

    Example 1:

    + +
    +Input: s = "abbcccaa"
    +Output: 13
    +Explanation: The homogenous substrings are listed as below:
    +"a"   appears 3 times.
    +"aa"  appears 1 time.
    +"b"   appears 2 times.
    +"bb"  appears 1 time.
    +"c"   appears 3 times.
    +"cc"  appears 2 times.
    +"ccc" appears 1 time.
    +3 + 1 + 2 + 1 + 3 + 2 + 1 = 13.
    + +

    Example 2:

    + +
    +Input: s = "xy"
    +Output: 2
    +Explanation: The homogenous substrings are "x" and "y".
    + +

    Example 3:

    + +
    +Input: s = "zzzzz"
    +Output: 15
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + [[String](../../tag/string/README.md)] + +### Hints +
    +Hint 1 +A string of only 'a's of length k contains k choose 2 homogenous substrings. +
    + +
    +Hint 2 +Split the string into substrings where each substring contains only one letter, and apply the formula on each substring's length. +
    diff --git a/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql b/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql index 66bb81aa2..989cb5c24 100644 --- a/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql +++ b/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql @@ -1,4 +1,4 @@ -Create table If Not Exists orders (order_number int, customer_number int, order_date date, required_date date, shipped_date date, status char(15), comment char(200), key(order_number)); +Create table If Not Exists orders (order_number int, customer_number int); Truncate table orders; insert into orders (order_number, customer_number) values ('1', '1'); insert into orders (order_number, customer_number) values ('2', '2'); diff --git a/problems/decode-ways-ii/README.md b/problems/decode-ways-ii/README.md index e7875df03..01d69c8a7 100644 --- a/problems/decode-ways-ii/README.md +++ b/problems/decode-ways-ii/README.md @@ -9,7 +9,7 @@                  [Next >](../solve-the-equation "Solve the Equation") -## [639. Decode Ways II (Hard)](https://leetcode.com/problems/decode-ways-ii "解码方法 2") +## [639. Decode Ways II (Hard)](https://leetcode.com/problems/decode-ways-ii "解码方法 II")

    A message containing letters from A-Z can be encoded into numbers using the following mapping:

    diff --git a/problems/design-an-ordered-stream/README.md b/problems/design-an-ordered-stream/README.md index 9dc2d1e53..b80e3bace 100644 --- a/problems/design-an-ordered-stream/README.md +++ b/problems/design-an-ordered-stream/README.md @@ -11,7 +11,7 @@ ## [1656. Design an Ordered Stream (Easy)](https://leetcode.com/problems/design-an-ordered-stream "设计有序流") -

    There is a stream of n (id, value) pairs arriving in an arbitrary order, where id is an integer between 1 and n and value is a string. No two pairs have the same id.

    +

    There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id.

    Design a stream that returns the values in increasing order of their IDs by returning a chunk (list) of values after each insertion. The concatenation of all the chunks should result in a list of the sorted values.

    @@ -19,7 +19,7 @@

     

    diff --git a/problems/design-most-recently-used-queue/README.md b/problems/design-most-recently-used-queue/README.md new file mode 100644 index 000000000..8f7116780 --- /dev/null +++ b/problems/design-most-recently-used-queue/README.md @@ -0,0 +1,34 @@ + + + + + + + +[< Previous](../closest-subsequence-sum "Closest Subsequence Sum") +                 +[Next >](../recyclable-and-low-fat-products "Recyclable and Low Fat Products") + +## [1756. Design Most Recently Used Queue (Medium)](https://leetcode.com/problems/design-most-recently-used-queue "") + + + +### Related Topics + [[Design](../../tag/design/README.md)] + [[Array](../../tag/array/README.md)] + +### Hints +
    +Hint 1 +You can store the data in an array and apply each fetch by moving the ith element to the end of the array (i.e, O(n) per operation). +
    + +
    +Hint 2 +A better way is to use the square root decomposition technique. +
    + +
    +Hint 3 +You can build chunks of size sqrt(n). For each fetch operation, You can search for the chunk which has the ith element and update it (i.e., O(sqrt(n)) per operation), and move this element to an empty chunk at the end. +
    diff --git a/problems/design-tic-tac-toe/README.md b/problems/design-tic-tac-toe/README.md index 46731adcc..7d822d9fb 100644 --- a/problems/design-tic-tac-toe/README.md +++ b/problems/design-tic-tac-toe/README.md @@ -9,7 +9,7 @@                  [Next >](../intersection-of-two-arrays "Intersection of Two Arrays") -## [348. Design Tic-Tac-Toe (Medium)](https://leetcode.com/problems/design-tic-tac-toe "判定井字棋胜负") +## [348. Design Tic-Tac-Toe (Medium)](https://leetcode.com/problems/design-tic-tac-toe "设计井字棋")

    Design a Tic-tac-toe game that is played between two players on a n x n grid.

    diff --git a/problems/distinct-subsequences/README.md b/problems/distinct-subsequences/README.md index c7d794543..e411aaf39 100644 --- a/problems/distinct-subsequences/README.md +++ b/problems/distinct-subsequences/README.md @@ -11,11 +11,11 @@ ## [115. Distinct Subsequences (Hard)](https://leetcode.com/problems/distinct-subsequences "不同的子序列") -

    Given two strings s and t, return the number of distinct subsequences of s which equals t.

    +

    Given two strings s and t, return the number of distinct subsequences of s which equals t.

    -

    A string's subsequence is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ACE" is a subsequence of "ABCDE" while "AEC" is not).

    +

    A string's subsequence is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the remaining characters' relative positions. (i.e., "ACE" is a subsequence of "ABCDE" while "AEC" is not).

    -

    It's guaranteed the answer fits on a 32-bit signed integer.

    +

    It is guaranteed the answer fits on a 32-bit signed integer.

     

    Example 1:

    diff --git a/problems/equal-rational-numbers/README.md b/problems/equal-rational-numbers/README.md index 1f778ea6a..7013c6e0b 100644 --- a/problems/equal-rational-numbers/README.md +++ b/problems/equal-rational-numbers/README.md @@ -11,64 +11,69 @@ ## [972. Equal Rational Numbers (Hard)](https://leetcode.com/problems/equal-rational-numbers "相等的有理数") -

    Given two strings S and T, each of which represents a non-negative rational number, return True if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.

    +

    Given two strings s and t, each of which represents a non-negative rational number, return true if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.

    -

    In general a rational number can be represented using up to three parts: an integer part, a non-repeating part, and a repeating part. The number will be represented in one of the following three ways:

    +

    A rational number can be represented using up to three parts: <IntegerPart>, <NonRepeatingPart>, and a <RepeatingPart>. The number will be represented in one of the following three ways:

    -

    The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets.  For example:

    +

    The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets. For example:

    -

    1 / 6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66)

    - -

    Both 0.1(6) or 0.1666(6) or 0.166(66) are correct representations of 1 / 6.

    +

     

    -

    Example 1:

    -Input: S = "0.(52)", T = "0.5(25)"
    -Output: true
    -Explanation:
    -Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number.
    +Input: s = "0.(52)", t = "0.5(25)"
    +Output: true
    +Explanation: Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number.
     
    -

    Example 2:

    -Input: S = "0.1666(6)", T = "0.166(66)"
    -Output: true
    +Input: s = "0.1666(6)", t = "0.166(66)"
    +Output: true
     
    -

    Example 3:

    -Input: S = "0.9(9)", T = "1."
    -Output: true
    -Explanation: 
    -"0.9(9)" represents 0.999999999... repeated forever, which equals 1.  [See this link for an explanation.]
    -"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "".
    +Input: s = "0.9(9)", t = "1." +Output: true +Explanation: "0.9(9)" represents 0.999999999... repeated forever, which equals 1. [See this link for an explanation.] +"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "". +

     

    -
    -
    - -

    Note:

    +

    Constraints:

    -
      +
    + ### Related Topics [[Math](../../tag/math/README.md)] diff --git a/problems/find-n-unique-integers-sum-up-to-zero/README.md b/problems/find-n-unique-integers-sum-up-to-zero/README.md index a4cb10af2..2251d1fbc 100644 --- a/problems/find-n-unique-integers-sum-up-to-zero/README.md +++ b/problems/find-n-unique-integers-sum-up-to-zero/README.md @@ -11,7 +11,7 @@ ## [1304. Find N Unique Integers Sum up to Zero (Easy)](https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero "和为零的N个唯一整数") -

    Given an integer n, return any array containing n unique integers such that they add up to 0.

    +

    Given an integer n, return any array containing n unique integers such that they add up to 0.

     

    Example 1:

    diff --git a/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md b/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md index d0ddb9996..33aa491a9 100644 --- a/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md +++ b/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md @@ -11,17 +11,15 @@ ## [1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance (Medium)](https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance "阈值距离内邻居最少的城市") -

    There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold.

    +

    There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold.

    -

    Return the city with the smallest number of cities that are reachable through some path and whose distance is at most distanceThreshold, If there are multiple such cities, return the city with the greatest number.

    +

    Return the city with the smallest number of cities that are reachable through some path and whose distance is at most distanceThreshold, If there are multiple such cities, return the city with the greatest number.

    Notice that the distance of a path connecting cities i and j is equal to the sum of the edges' weights along that path.

     

    Example 1:

    - -

    - +
     Input: n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4
     Output: 3
    @@ -35,9 +33,7 @@ Cities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have
     

    Example 2:

    - -

    - +
     Input: n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2
     Output: 0
    diff --git a/problems/find-the-subtasks-that-did-not-execute/README.md b/problems/find-the-subtasks-that-did-not-execute/README.md
    new file mode 100644
    index 000000000..98fd0f448
    --- /dev/null
    +++ b/problems/find-the-subtasks-that-did-not-execute/README.md
    @@ -0,0 +1,14 @@
    +
    +
    +
    +
    +
    +
    +
    +[< Previous](../tree-of-coprimes "Tree of Coprimes")
    +                
    +[Next >](../merge-strings-alternately "Merge Strings Alternately")
    +
    +## [1767. Find the Subtasks That Did Not Execute (Hard)](https://leetcode.com/problems/find-the-subtasks-that-did-not-execute "")
    +
    +
    diff --git a/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql b/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql
    new file mode 100644
    index 000000000..fd4398ea6
    --- /dev/null
    +++ b/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql
    @@ -0,0 +1,12 @@
    +Create table If Not Exists Tasks (task_id int, subtasks_count int);
    +Create table If Not Exists Executed (task_id int, subtask_id int);
    +Truncate table Tasks;
    +insert into Tasks (task_id, subtasks_count) values ('1', '3');
    +insert into Tasks (task_id, subtasks_count) values ('2', '2');
    +insert into Tasks (task_id, subtasks_count) values ('3', '4');
    +Truncate table Executed;
    +insert into Executed (task_id, subtask_id) values ('1', '2');
    +insert into Executed (task_id, subtask_id) values ('3', '1');
    +insert into Executed (task_id, subtask_id) values ('3', '2');
    +insert into Executed (task_id, subtask_id) values ('3', '3');
    +insert into Executed (task_id, subtask_id) values ('3', '4');
    diff --git a/problems/flip-binary-tree-to-match-preorder-traversal/README.md b/problems/flip-binary-tree-to-match-preorder-traversal/README.md
    index 516b4670a..f5288b36a 100644
    --- a/problems/flip-binary-tree-to-match-preorder-traversal/README.md
    +++ b/problems/flip-binary-tree-to-match-preorder-traversal/README.md
    @@ -11,15 +11,13 @@
     
     ## [971. Flip Binary Tree To Match Preorder Traversal (Medium)](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal "翻转二叉树以匹配先序遍历")
     
    -

    You are given the root of a binary tree with n nodes, each node has a different value from 1 to n. You are also given a sequence of n values voyage, reported by a preorder traversal starting from the root.

    +

    You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n values voyage, which is the desired pre-order traversal of the binary tree.

    -

    A node in this binary tree can be flipped by swapping its left child and its right child.

    +

    Any node in the binary tree can be flipped by swapping its left and right subtrees. For example, flipping node 1 will have the following effect:

    + +

    Flip the smallest number of nodes so that the pre-order traversal of the tree matches voyage.

    -

    Flip the least number of nodes in the tree so that the preorder traversal of the tree matches voyage.

    - -

    Return a list of the values of all nodes flipped. You may return the answer in any order. If we cannot flip the nodes in the tree to obtain voyage, return the list [-1].

    - -

    The preorder traversal of a node means we report the current node's value, then preorder-traverse the left child, then preorder-traverse the right child.

    +

    Return a list of the values of all flipped nodes. You may return the answer in any order. If it is impossible to flip the nodes in the tree to make the pre-order traversal match voyage, return the list [-1].

     

    Example 1:

    @@ -27,6 +25,7 @@
     Input: root = [1,2], voyage = [2,1]
     Output: [-1]
    +Explanation: It is impossible to flip the nodes such that the pre-order traversal matches voyage.
     

    Example 2:

    @@ -34,13 +33,14 @@
     Input: root = [1,2,3], voyage = [1,3,2]
     Output: [1]
    -
    +Explanation: Flipping node 1 swaps nodes 2 and 3, so the pre-order traversal matches voyage.

    Example 3:

     Input: root = [1,2,3], voyage = [1,2,3]
     Output: []
    +Explanation: The tree's pre-order traversal already matches voyage, so no nodes need to be flipped.
     

     

    @@ -51,8 +51,8 @@
  • n == voyage.length
  • 1 <= n <= 100
  • 1 <= Node.val, voyage[i] <= n
  • -
  • All the values of the tree are unique.
  • -
  • All the values of voyage are unique.
  • +
  • All the values in the tree are unique.
  • +
  • All the values in voyage are unique.
  • ### Related Topics diff --git a/problems/form-array-by-concatenating-subarrays-of-another-array/README.md b/problems/form-array-by-concatenating-subarrays-of-another-array/README.md new file mode 100644 index 000000000..70d5d05e6 --- /dev/null +++ b/problems/form-array-by-concatenating-subarrays-of-another-array/README.md @@ -0,0 +1,74 @@ + + + + + + + +[< Previous](../longest-nice-substring "Longest Nice Substring") +                 +[Next >](../map-of-highest-peak "Map of Highest Peak") + +## [1764. Form Array by Concatenating Subarrays of Another Array (Medium)](https://leetcode.com/problems/form-array-by-concatenating-subarrays-of-another-array "通过连接另一个数组的子数组得到一个数组") + +

    You are given a 2D integer array groups of length n. You are also given an integer array nums.

    + +

    You are asked if you can choose n disjoint subarrays from the array nums such that the ith subarray is equal to groups[i] (0-indexed), and if i > 0, the (i-1)th subarray appears before the ith subarray in nums (i.e. the subarrays must be in the same order as groups).

    + +

    Return true if you can do this task, and false otherwise.

    + +

    Note that the subarrays are disjoint if and only if there is no index k such that nums[k] belongs to more than one subarray. A subarray is a contiguous sequence of elements within an array.

    + +

     

    +

    Example 1:

    + +
    +Input: groups = [[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0]
    +Output: true
    +Explanation: You can choose the 0th subarray as [1,-1,0,1,-1,-1,3,-2,0] and the 1st one as [1,-1,0,1,-1,-1,3,-2,0].
    +These subarrays are disjoint as they share no common nums[k] element.
    +
    + +

    Example 2:

    + +
    +Input: groups = [[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2]
    +Output: false
    +Explanation: Note that choosing the subarrays [1,2,3,4,10,-2] and [1,2,3,4,10,-2] is incorrect because they are not in the same order as in groups.
    +[10,-2] must come before [1,2,3,4].
    +
    + +

    Example 3:

    + +
    +Input: groups = [[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7]
    +Output: false
    +Explanation: Note that choosing the subarrays [7,7,1,2,3,4,7,7] and [7,7,1,2,3,4,7,7] is invalid because they are not disjoint.
    +They share a common elements nums[4] (0-indexed).
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + [[Array](../../tag/array/README.md)] + +### Hints +
    +Hint 1 +When we use a subarray, the room for the next subarrays will be the suffix after the used subarray. +
    + +
    +Hint 2 +If we can match a group with multiple subarrays, we should choose the first one, as this will just leave the largest room for the next subarrays. +
    diff --git a/problems/is-graph-bipartite/README.md b/problems/is-graph-bipartite/README.md index ff69add19..d5f24efcd 100644 --- a/problems/is-graph-bipartite/README.md +++ b/problems/is-graph-bipartite/README.md @@ -11,41 +11,45 @@ ## [785. Is Graph Bipartite? (Medium)](https://leetcode.com/problems/is-graph-bipartite "判断二分图") -

    Given an undirected graph, return true if and only if it is bipartite.

    +

    There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has the following properties:

    -

    Recall that a graph is bipartite if we can split its set of nodes into two independent subsets A and B, such that every edge in the graph has one node in A and another node in B.

    + -

    The graph is given in the following form: graph[i] is a list of indexes j for which the edge between nodes i and j exists.  Each node is an integer between 0 and graph.length - 1.  There are no self edges or parallel edges: graph[i] does not contain i, and it doesn't contain any element twice.

    +

    A graph is bipartite if the nodes can be partitioned into two independent sets A and B such that every edge in the graph connects a node in set A and a node in set B.

    + +

    Return true if and only if it is bipartite.

     

    Example 1:

    - -
    -Input: graph = [[1,3],[0,2],[1,3],[0,2]]
    -Output: true
    -Explanation: We can divide the vertices into two groups: {0, 2} and {1, 3}.
    -
    -
    - -

    Example 2:

     Input: graph = [[1,2,3],[0,2],[0,1,3],[0,2]]
     Output: false
    -Explanation: We cannot find a way to divide the set of nodes into two independent subsets.
    +Explanation: There is no way to partition the nodes into two independent sets such that every edge connects a node in one and a node in the other.
    - +

    Example 2:

    + +
    +Input: graph = [[1,3],[0,2],[1,3],[0,2]]
    +Output: true
    +Explanation: We can partition the nodes into two sets: {0, 2} and {1, 3}.

     

    Constraints:

    ### Related Topics diff --git a/problems/kth-smallest-element-in-a-sorted-matrix/README.md b/problems/kth-smallest-element-in-a-sorted-matrix/README.md index b9418780d..1f2780795 100644 --- a/problems/kth-smallest-element-in-a-sorted-matrix/README.md +++ b/problems/kth-smallest-element-in-a-sorted-matrix/README.md @@ -9,7 +9,7 @@                  [Next >](../design-phone-directory "Design Phone Directory") -## [378. Kth Smallest Element in a Sorted Matrix (Medium)](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix "有序矩阵中第K小的元素") +## [378. Kth Smallest Element in a Sorted Matrix (Medium)](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix "有序矩阵中第 K 小的元素")

    Given an n x n matrix where each of the rows and columns are sorted in ascending order, return the kth smallest element in the matrix.

    @@ -21,7 +21,7 @@
     Input: matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8
     Output: 13
    -Explanation: The elements in the matrix are [1,5,9,10,11,12,13,13,15], and the 8th largest number is 13
    +Explanation: The elements in the matrix are [1,5,9,10,11,12,13,13,15], and the 8th smallest number is 13
     

    Example 2:

    diff --git a/problems/largest-merge-of-two-strings/README.md b/problems/largest-merge-of-two-strings/README.md new file mode 100644 index 000000000..0892bf50e --- /dev/null +++ b/problems/largest-merge-of-two-strings/README.md @@ -0,0 +1,85 @@ + + + + + + + +[< Previous](../maximum-score-from-removing-stones "Maximum Score From Removing Stones") +                 +[Next >](../closest-subsequence-sum "Closest Subsequence Sum") + +## [1754. Largest Merge Of Two Strings (Medium)](https://leetcode.com/problems/largest-merge-of-two-strings "构造字典序最大的合并字符串") + +

    You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choose one of the following options:

    + + + +

    Return the lexicographically largest merge you can construct.

    + +

    A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b. For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.

    + +

     

    +

    Example 1:

    + +
    +Input: word1 = "cabaa", word2 = "bcaaa"
    +Output: "cbcabaaaaa"
    +Explanation: One way to get the lexicographically largest merge is:
    +- Take from word1: merge = "c", word1 = "abaa", word2 = "bcaaa"
    +- Take from word2: merge = "cb", word1 = "abaa", word2 = "caaa"
    +- Take from word2: merge = "cbc", word1 = "abaa", word2 = "aaa"
    +- Take from word1: merge = "cbca", word1 = "baa", word2 = "aaa"
    +- Take from word1: merge = "cbcab", word1 = "aa", word2 = "aaa"
    +- Append the remaining 5 a's from word1 and word2 at the end of merge.
    +
    + +

    Example 2:

    + +
    +Input: word1 = "abcabc", word2 = "abdcaba"
    +Output: "abdcabcabcaba"
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + +### Hints +
    +Hint 1 +Build the result character by character. At each step, you choose a character from one of the two strings. +
    + +
    +Hint 2 +If the next character of the first string is larger than that of the second string, or vice versa, it's optimal to use the larger one. +
    + +
    +Hint 3 +If both are equal, think of a criteria that lets you decide which string to consume the next character from. +
    + +
    +Hint 4 +You should choose the next character from the larger string. +
    diff --git a/problems/leetflex-banned-accounts/README.md b/problems/leetflex-banned-accounts/README.md index 3977c250a..3efd973fc 100644 --- a/problems/leetflex-banned-accounts/README.md +++ b/problems/leetflex-banned-accounts/README.md @@ -7,7 +7,7 @@ [< Previous](../maximum-subarray-sum-after-one-operation "Maximum Subarray Sum After One Operation")                  -Next > +[Next >](../sum-of-unique-elements "Sum of Unique Elements") ## [1747. Leetflex Banned Accounts (Medium)](https://leetcode.com/problems/leetflex-banned-accounts "") diff --git a/problems/longest-nice-substring/README.md b/problems/longest-nice-substring/README.md new file mode 100644 index 000000000..deefb52e2 --- /dev/null +++ b/problems/longest-nice-substring/README.md @@ -0,0 +1,65 @@ + + + + + + + +[< Previous](../buildings-with-an-ocean-view "Buildings With an Ocean View") +                 +[Next >](../form-array-by-concatenating-subarrays-of-another-array "Form Array by Concatenating Subarrays of Another Array") + +## [1763. Longest Nice Substring (Easy)](https://leetcode.com/problems/longest-nice-substring "最长的美好子字符串") + +

    A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.

    + +

    Given a string s, return the longest substring of s that is nice. If there are multiple, return the substring of the earliest occurrence. If there are none, return an empty string.

    + +

     

    +

    Example 1:

    + +
    +Input: s = "YazaAay"
    +Output: "aAa"
    +Explanation: "aAa" is a nice string because 'A/a' is the only letter of the alphabet in s, and both 'A' and 'a' appear.
    +"aAa" is the longest nice substring.
    +
    + +

    Example 2:

    + +
    +Input: s = "Bb"
    +Output: "Bb"
    +Explanation: "Bb" is a nice string because both 'B' and 'b' appear. The whole string is a substring.
    + +

    Example 3:

    + +
    +Input: s = "c"
    +Output: ""
    +Explanation: There are no nice substrings.
    + +

    Example 4:

    + +
    +Input: s = "dDzeE"
    +Output: "dD"
    +Explanation: Both "dD" and "eE" are the longest nice substrings.
    +As there are multiple longest nice substrings, return "dD" since it occurs earlier.
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[String](../../tag/string/README.md)] + +### Hints +
    +Hint 1 +Brute force and check each substring to see if it is nice. +
    diff --git a/problems/longest-word-in-dictionary-through-deleting/README.md b/problems/longest-word-in-dictionary-through-deleting/README.md index 6b9cecf28..c6d3d8a6b 100644 --- a/problems/longest-word-in-dictionary-through-deleting/README.md +++ b/problems/longest-word-in-dictionary-through-deleting/README.md @@ -11,37 +11,41 @@ ## [524. Longest Word in Dictionary through Deleting (Medium)](https://leetcode.com/problems/longest-word-in-dictionary-through-deleting "通过删除字母匹配到字典里最长单词") -

    -Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string. -

    -

    Example 1:
    +

    Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.

    + +

    Example 1:

    +
     Input:
    -s = "abpcplea", d = ["ale","apple","monkey","plea"]
    +s = "abpcplea", d = ["ale","apple","monkey","plea"]
     
     Output: 
    -"apple"
    +"apple"
     
    -

    -

    -

    Example 2:
    +

     

    + +

    Example 2:

    +
     Input:
    -s = "abpcplea", d = ["a","b","c"]
    +s = "abpcplea", d = ["a","b","c"]
     
     Output: 
    -"a"
    +"a"
     
    -

    -

    Note:
    +

     

    + +

    Note:

    +
      -
    1. All the strings in the input will only contain lower-case letters.
    2. -
    3. The size of the dictionary won't exceed 1,000.
    4. -
    5. The length of all the strings in the input won't exceed 1,000.
    6. +
    7. All the strings in the input will only contain lower-case letters.
    8. +
    9. The size of the dictionary won't exceed 1,000.
    10. +
    11. The length of all the strings in the input won't exceed 1,000.
    -

    + +

     

    ### Related Topics [[Sort](../../tag/sort/README.md)] diff --git a/problems/map-of-highest-peak/README.md b/problems/map-of-highest-peak/README.md new file mode 100644 index 000000000..2b8cfaa18 --- /dev/null +++ b/problems/map-of-highest-peak/README.md @@ -0,0 +1,80 @@ + + + + + + + +[< Previous](../form-array-by-concatenating-subarrays-of-another-array "Form Array by Concatenating Subarrays of Another Array") +                 +[Next >](../tree-of-coprimes "Tree of Coprimes") + +## [1765. Map of Highest Peak (Medium)](https://leetcode.com/problems/map-of-highest-peak "地图中的最高点") + +

    You are given an integer matrix isWater of size m x n that represents a map of land and water cells.

    + + + +

    You must assign each cell a height in a way that follows these rules:

    + + + +

    Find an assignment of heights such that the maximum height in the matrix is maximized.

    + +

    Return an integer matrix height of size m x n where height[i][j] is cell (i, j)'s height. If there are multiple solutions, return any of them.

    + +

     

    +

    Example 1:

    + +

    + +
    +Input: isWater = [[0,1],[0,0]]
    +Output: [[1,0],[2,1]]
    +Explanation: The image shows the assigned heights of each cell.
    +The blue cell is the water cell, and the green cells are the land cells.
    +
    + +

    Example 2:

    + +

    + +
    +Input: isWater = [[0,0,1],[1,0,0],[0,0,0]]
    +Output: [[1,1,0],[0,1,1],[1,2,2]]
    +Explanation: A height of 2 is the maximum possible height of any assignment.
    +Any height assignment that has a maximum height of 2 while still meeting the rules will also be accepted.
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Breadth-first Search](../../tag/breadth-first-search/README.md)] + [[Graph](../../tag/graph/README.md)] + +### Hints +
    +Hint 1 +Set each water cell to be 0. The height of each cell is limited by its closest water cell. +
    + +
    +Hint 2 +Perform a multi-source BFS with all the water cells as sources. +
    diff --git a/problems/max-consecutive-ones/README.md b/problems/max-consecutive-ones/README.md index 3b77bb078..185c3b257 100644 --- a/problems/max-consecutive-ones/README.md +++ b/problems/max-consecutive-ones/README.md @@ -9,7 +9,7 @@                  [Next >](../predict-the-winner "Predict the Winner") -## [485. Max Consecutive Ones (Easy)](https://leetcode.com/problems/max-consecutive-ones "最大连续1的个数") +## [485. Max Consecutive Ones (Easy)](https://leetcode.com/problems/max-consecutive-ones "最大连续 1 的个数")

    Given a binary array, find the maximum number of consecutive 1s in this array.

    diff --git a/problems/maximize-palindrome-length-from-subsequences/README.md b/problems/maximize-palindrome-length-from-subsequences/README.md new file mode 100644 index 000000000..627b4c671 --- /dev/null +++ b/problems/maximize-palindrome-length-from-subsequences/README.md @@ -0,0 +1,70 @@ + + + + + + + +[< Previous](../maximum-score-from-performing-multiplication-operations "Maximum Score from Performing Multiplication Operations") +                 +Next > + +## [1771. Maximize Palindrome Length From Subsequences (Hard)](https://leetcode.com/problems/maximize-palindrome-length-from-subsequences "由子序列构造的最长回文串的长度") + +

    You are given two strings, word1 and word2. You want to construct a string in the following manner:

    + + + +

    Return the length of the longest palindrome that can be constructed in the described manner. If no palindromes can be constructed, return 0.

    + +

    A subsequence of a string s is a string that can be made by deleting some (possibly none) characters from s without changing the order of the remaining characters.

    + +

    A palindrome is a string that reads the same forward as well as backward.

    + +

     

    +

    Example 1:

    + +
    +Input: word1 = "cacb", word2 = "cbba"
    +Output: 5
    +Explanation: Choose "ab" from word1 and "cba" from word2 to make "abcba", which is a palindrome.
    + +

    Example 2:

    + +
    +Input: word1 = "ab", word2 = "ab"
    +Output: 3
    +Explanation: Choose "ab" from word1 and "a" from word2 to make "aba", which is a palindrome.
    + +

    Example 3:

    + +
    +Input: word1 = "aa", word2 = "bb"
    +Output: 0
    +Explanation: You cannot construct a palindrome from the described method, so return 0.
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Dynamic Programming](../../tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming. +
    + +
    +Hint 2 +Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subsequences are non-empty. +
    diff --git a/problems/maximum-absolute-sum-of-any-subarray/README.md b/problems/maximum-absolute-sum-of-any-subarray/README.md new file mode 100644 index 000000000..201f7ff7e --- /dev/null +++ b/problems/maximum-absolute-sum-of-any-subarray/README.md @@ -0,0 +1,72 @@ + + + + + + + +[< Previous](../sum-of-unique-elements "Sum of Unique Elements") +                 +[Next >](../minimum-length-of-string-after-deleting-similar-ends "Minimum Length of String After Deleting Similar Ends") + +## [1749. Maximum Absolute Sum of Any Subarray (Medium)](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray "任意子数组和的绝对值的最大值") + +

    You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl + numsl+1 + ... + numsr-1 + numsr).

    + +

    Return the maximum absolute sum of any (possibly empty) subarray of nums.

    + +

    Note that abs(x) is defined as follows:

    + + + +

     

    +

    Example 1:

    + +
    +Input: nums = [1,-3,2,3,-4]
    +Output: 5
    +Explanation: The subarray [2,3] has absolute sum = abs(2+3) = abs(5) = 5.
    +
    + +

    Example 2:

    + +
    +Input: nums = [2,-5,1,-4,3,-2]
    +Output: 8
    +Explanation: The subarray [-5,1,-4] has absolute sum = abs(-5+1-4) = abs(-8) = 8.
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + +### Hints +
    +Hint 1 +What if we asked for maximum sum, not absolute sum? +
    + +
    +Hint 2 +It's a standard problem that can be solved by Kadane's algorithm. +
    + +
    +Hint 3 +The key idea is the max absolute sum will be either the max sum or the min sum. +
    + +
    +Hint 4 +So just run kadane twice, once calculating the max sum and once calculating the min sum. +
    diff --git a/problems/maximum-number-of-events-that-can-be-attended-ii/README.md b/problems/maximum-number-of-events-that-can-be-attended-ii/README.md new file mode 100644 index 000000000..f61651cc9 --- /dev/null +++ b/problems/maximum-number-of-events-that-can-be-attended-ii/README.md @@ -0,0 +1,72 @@ + + + + + + + +[< Previous](../minimum-length-of-string-after-deleting-similar-ends "Minimum Length of String After Deleting Similar Ends") +                 +[Next >](../check-if-array-is-sorted-and-rotated "Check if Array Is Sorted and Rotated") + +## [1751. Maximum Number of Events That Can Be Attended II (Hard)](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii "最多可以参加的会议数目 II") + +

    You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayi and ends at endDayi, and if you attend this event, you will receive a value of valuei. You are also given an integer k which represents the maximum number of events you can attend.

    + +

    You can only attend one event at a time. If you choose to attend an event, you must attend the entire event. Note that the end day is inclusive: that is, you cannot attend two events where one of them starts and the other ends on the same day.

    + +

    Return the maximum sum of values that you can receive by attending events.

    + +

     

    +

    Example 1:

    + +

    + +
    +Input: events = [[1,2,4],[3,4,3],[2,3,1]], k = 2
    +Output: 7
    +Explanation: Choose the green events, 0 and 1 (0-indexed) for a total value of 4 + 3 = 7.
    + +

    Example 2:

    + +

    + +
    +Input: events = [[1,2,4],[3,4,3],[2,3,10]], k = 2
    +Output: 10
    +Explanation: Choose event 2 for a total value of 10.
    +Notice that you cannot attend any other event as they overlap, and that you do not have to attend k events.
    + +

    Example 3:

    + +

    + +
    +Input: events = [[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3
    +Output: 9
    +Explanation: Although the events do not overlap, you can only attend 3 events. Pick the highest valued three.
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Binary Search](../../tag/binary-search/README.md)] + [[Dynamic Programming](../../tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Sort the events by its startTime. +
    + +
    +Hint 2 +For every event, you can either choose it and consider the next event available, or you can ignore it. You can efficiently find the next event that is available using binary search. +
    diff --git a/problems/maximum-score-from-performing-multiplication-operations/README.md b/problems/maximum-score-from-performing-multiplication-operations/README.md new file mode 100644 index 000000000..097d29180 --- /dev/null +++ b/problems/maximum-score-from-performing-multiplication-operations/README.md @@ -0,0 +1,80 @@ + + + + + + + +[< Previous](../minimum-number-of-operations-to-move-all-balls-to-each-box "Minimum Number of Operations to Move All Balls to Each Box") +                 +[Next >](../maximize-palindrome-length-from-subsequences "Maximize Palindrome Length From Subsequences") + +## [1770. Maximum Score from Performing Multiplication Operations (Medium)](https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations "执行乘法运算的最大分数") + +

    You are given two integer arrays nums and multipliers of size n and m respectively, where n >= m. The arrays are 1-indexed.

    + +

    You begin with a score of 0. You want to perform exactly m operations. On the ith operation (1-indexed), you will:

    + + + +

    Return the maximum score after performing m operations.

    + +

     

    +

    Example 1:

    + +
    +Input: nums = [1,2,3], multipliers = [3,2,1]
    +Output: 14
    +Explanation: An optimal solution is as follows:
    +- Choose from the end, [1,2,3], adding 3 * 3 = 9 to the score.
    +- Choose from the end, [1,2], adding 2 * 2 = 4 to the score.
    +- Choose from the end, [1], adding 1 * 1 = 1 to the score.
    +The total score is 9 + 4 + 1 = 14.
    + +

    Example 2:

    + +
    +Input: nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6]
    +Output: 102
    +Explanation: An optimal solution is as follows:
    +- Choose from the start, [-5,-3,-3,-2,7,1], adding -5 * -10 = 50 to the score.
    +- Choose from the start, [-3,-3,-2,7,1], adding -3 * -5 = 15 to the score.
    +- Choose from the start, [-3,-2,7,1], adding -3 * 3 = -9 to the score.
    +- Choose from the end, [-2,7,1], adding 1 * 4 = 4 to the score.
    +- Choose from the end, [-2,7], adding 7 * 6 = 42 to the score. 
    +The total score is 50 + 15 - 9 + 4 + 42 = 102.
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Dynamic Programming](../../tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +At first glance, the solution seems to be greedy, but if you try to greedily take the largest value from the begging or the end, this will not be optimal. +
    + +
    +Hint 2 +You should try all scenarios but this will be costy. +
    + +
    +Hint 3 +Memoizing the pre-visited states while trying all the possible scenarios will reduce the complexity, and hence dp is the perfect choice here. +
    diff --git a/problems/maximum-score-from-removing-stones/README.md b/problems/maximum-score-from-removing-stones/README.md new file mode 100644 index 000000000..dd2d1cc49 --- /dev/null +++ b/problems/maximum-score-from-removing-stones/README.md @@ -0,0 +1,79 @@ + + + + + + + +[< Previous](../check-if-array-is-sorted-and-rotated "Check if Array Is Sorted and Rotated") +                 +[Next >](../largest-merge-of-two-strings "Largest Merge Of Two Strings") + +## [1753. Maximum Score From Removing Stones (Medium)](https://leetcode.com/problems/maximum-score-from-removing-stones "移除石子的最大得分") + +

    You are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non-empty piles, take one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles (meaning there are no more available moves).

    + +

    Given three integers a​​​​​, b,​​​​​ and c​​​​​, return the maximum score you can get.

    + +

     

    +

    Example 1:

    + +
    +Input: a = 2, b = 4, c = 6
    +Output: 6
    +Explanation: The starting state is (2, 4, 6). One optimal set of moves is:
    +- Take from 1st and 3rd piles, state is now (1, 4, 5)
    +- Take from 1st and 3rd piles, state is now (0, 4, 4)
    +- Take from 2nd and 3rd piles, state is now (0, 3, 3)
    +- Take from 2nd and 3rd piles, state is now (0, 2, 2)
    +- Take from 2nd and 3rd piles, state is now (0, 1, 1)
    +- Take from 2nd and 3rd piles, state is now (0, 0, 0)
    +There are fewer than two non-empty piles, so the game ends. Total: 6 points.
    +
    + +

    Example 2:

    + +
    +Input: a = 4, b = 4, c = 6
    +Output: 7
    +Explanation: The starting state is (4, 4, 6). One optimal set of moves is:
    +- Take from 1st and 2nd piles, state is now (3, 3, 6)
    +- Take from 1st and 3rd piles, state is now (2, 3, 5)
    +- Take from 1st and 3rd piles, state is now (1, 3, 4)
    +- Take from 1st and 3rd piles, state is now (0, 3, 3)
    +- Take from 2nd and 3rd piles, state is now (0, 2, 2)
    +- Take from 2nd and 3rd piles, state is now (0, 1, 1)
    +- Take from 2nd and 3rd piles, state is now (0, 0, 0)
    +There are fewer than two non-empty piles, so the game ends. Total: 7 points.
    +
    + +

    Example 3:

    + +
    +Input: a = 1, b = 8, c = 8
    +Output: 8
    +Explanation: One optimal set of moves is to take from the 2nd and 3rd piles for 8 turns until they are empty.
    +After that, there are fewer than two non-empty piles, so the game ends.
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Heap](../../tag/heap/README.md)] + [[Math](../../tag/math/README.md)] + +### Hints +
    +Hint 1 +It's optimal to always remove one stone from the biggest 2 piles +
    + +
    +Hint 2 +Note that the limits are small enough for simulation +
    diff --git a/problems/merge-strings-alternately/README.md b/problems/merge-strings-alternately/README.md new file mode 100644 index 000000000..649329a07 --- /dev/null +++ b/problems/merge-strings-alternately/README.md @@ -0,0 +1,67 @@ + + + + + + + +[< Previous](../find-the-subtasks-that-did-not-execute "Find the Subtasks That Did Not Execute") +                 +[Next >](../minimum-number-of-operations-to-move-all-balls-to-each-box "Minimum Number of Operations to Move All Balls to Each Box") + +## [1768. Merge Strings Alternately (Easy)](https://leetcode.com/problems/merge-strings-alternately "交替合并字符串") + +

    You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.

    + +

    Return the merged string.

    + +

     

    +

    Example 1:

    + +
    +Input: word1 = "abc", word2 = "pqr"
    +Output: "apbqcr"
    +Explanation: The merged string will be merged as so:
    +word1:  a   b   c
    +word2:    p   q   r
    +merged: a p b q c r
    +
    + +

    Example 2:

    + +
    +Input: word1 = "ab", word2 = "pqrs"
    +Output: "apbqrs"
    +Explanation: Notice that as word2 is longer, "rs" is appended to the end.
    +word1:  a   b 
    +word2:    p   q   r   s
    +merged: a p b q   r   s
    +
    + +

    Example 3:

    + +
    +Input: word1 = "abcd", word2 = "pq"
    +Output: "apbqcd"
    +Explanation: Notice that as word1 is longer, "cd" is appended to the end.
    +word1:  a   b   c   d
    +word2:    p   q 
    +merged: a p b q c   d
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[String](../../tag/string/README.md)] + +### Hints +
    +Hint 1 +Use two pointers, one pointer for each string. Alternately choose the character from each pointer, and move the pointer upwards. +
    diff --git a/problems/minimum-changes-to-make-alternating-binary-string/README.md b/problems/minimum-changes-to-make-alternating-binary-string/README.md new file mode 100644 index 000000000..b5c8bb806 --- /dev/null +++ b/problems/minimum-changes-to-make-alternating-binary-string/README.md @@ -0,0 +1,71 @@ + + + + + + + +[< Previous](../recyclable-and-low-fat-products "Recyclable and Low Fat Products") +                 +[Next >](../count-number-of-homogenous-substrings "Count Number of Homogenous Substrings") + +## [1758. Minimum Changes To Make Alternating Binary String (Easy)](https://leetcode.com/problems/minimum-changes-to-make-alternating-binary-string "生成交替二进制字符串的最少操作数") + +

    You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa.

    + +

    The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not.

    + +

    Return the minimum number of operations needed to make s alternating.

    + +

     

    +

    Example 1:

    + +
    +Input: s = "0100"
    +Output: 1
    +Explanation: If you change the last character to '1', s will be "0101", which is alternating.
    +
    + +

    Example 2:

    + +
    +Input: s = "10"
    +Output: 0
    +Explanation: s is already alternating.
    +
    + +

    Example 3:

    + +
    +Input: s = "1111"
    +Output: 2
    +Explanation: You need two operations to reach "0101" or "1010".
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + [[Array](../../tag/array/README.md)] + +### Hints +
    +Hint 1 +Think about how the final string will look like. +
    + +
    +Hint 2 +It will either start with a '0' and be like '010101010..' or with a '1' and be like '10101010..' +
    + +
    +Hint 3 +Try both ways, and check for each way, the number of changes needed to reach it from the given string. The answer is the minimum of both ways. +
    diff --git a/problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md b/problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md new file mode 100644 index 000000000..7f3055dc2 --- /dev/null +++ b/problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md @@ -0,0 +1,66 @@ + + + + + + + +[< Previous](../minimum-limit-of-balls-in-a-bag "Minimum Limit of Balls in a Bag") +                 +[Next >](../buildings-with-an-ocean-view "Buildings With an Ocean View") + +## [1761. Minimum Degree of a Connected Trio in a Graph (Hard)](https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph "一个图中连通三元组的最小度数") + +

    You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi.

    + +

    A connected trio is a set of three nodes where there is an edge between every pair of them.

    + +

    The degree of a connected trio is the number of edges where one endpoint is in the trio, and the other is not.

    + +

    Return the minimum degree of a connected trio in the graph, or -1 if the graph has no connected trios.

    + +

     

    +

    Example 1:

    + +
    +Input: n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]
    +Output: 3
    +Explanation: There is exactly one trio, which is [1,2,3]. The edges that form its degree are bolded in the figure above.
    +
    + +

    Example 2:

    + +
    +Input: n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]
    +Output: 0
    +Explanation: There are exactly three trios:
    +1) [1,4,3] with degree 0.
    +2) [2,5,6] with degree 2.
    +3) [5,6,7] with degree 2.
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Graph](../../tag/graph/README.md)] + +### Hints +
    +Hint 1 +Consider a trio with nodes u, v, and w. The degree of the trio is just degree(u) + degree(v) + degree(w) - 6. The -6 comes from subtracting the edges u-v, u-w, and v-w, which are counted twice each in the vertex degree calculation. +
    + +
    +Hint 2 +To get the trios (u,v,w), you can iterate on u, then iterate on each w,v such that w and v are neighbors of u and are neighbors of each other. +
    diff --git a/problems/minimum-length-of-string-after-deleting-similar-ends/README.md b/problems/minimum-length-of-string-after-deleting-similar-ends/README.md new file mode 100644 index 000000000..9778661bb --- /dev/null +++ b/problems/minimum-length-of-string-after-deleting-similar-ends/README.md @@ -0,0 +1,76 @@ + + + + + + + +[< Previous](../maximum-absolute-sum-of-any-subarray "Maximum Absolute Sum of Any Subarray") +                 +[Next >](../maximum-number-of-events-that-can-be-attended-ii "Maximum Number of Events That Can Be Attended II") + +## [1750. Minimum Length of String After Deleting Similar Ends (Medium)](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends "删除字符串两端相同字符后的最短长度") + +

    Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number of times:

    + +
      +
    1. Pick a non-empty prefix from the string s where all the characters in the prefix are equal.
    2. +
    3. Pick a non-empty suffix from the string s where all the characters in this suffix are equal.
    4. +
    5. The prefix and the suffix should not intersect at any index.
    6. +
    7. The characters from the prefix and suffix must be the same.
    8. +
    9. Delete both the prefix and the suffix.
    10. +
    + +

    Return the minimum length of s after performing the above operation any number of times (possibly zero times).

    + +

     

    +

    Example 1:

    + +
    +Input: s = "ca"
    +Output: 2
    +Explanation: You can't remove any characters, so the string stays as is.
    +
    + +

    Example 2:

    + +
    +Input: s = "cabaabac"
    +Output: 0
    +Explanation: An optimal sequence of operations is:
    +- Take prefix = "c" and suffix = "c" and remove them, s = "abaaba".
    +- Take prefix = "a" and suffix = "a" and remove them, s = "baab".
    +- Take prefix = "b" and suffix = "b" and remove them, s = "aa".
    +- Take prefix = "a" and suffix = "a" and remove them, s = "".
    + +

    Example 3:

    + +
    +Input: s = "aabccabba"
    +Output: 3
    +Explanation: An optimal sequence of operations is:
    +- Take prefix = "aa" and suffix = "a" and remove them, s = "bccabb".
    +- Take prefix = "b" and suffix = "bb" and remove them, s = "cca".
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Two Pointers](../../tag/two-pointers/README.md)] + +### Hints +
    +Hint 1 +If both ends have distinct characters, no more operations can be made. Otherwise, the only operation is to remove all of the same characters from both ends. We will do this as many times as we can. +
    + +
    +Hint 2 +Note that if the length is equal 1 the answer is 1 +
    diff --git a/problems/minimum-limit-of-balls-in-a-bag/README.md b/problems/minimum-limit-of-balls-in-a-bag/README.md new file mode 100644 index 000000000..bfeefb85f --- /dev/null +++ b/problems/minimum-limit-of-balls-in-a-bag/README.md @@ -0,0 +1,83 @@ + + + + + + + +[< Previous](../count-number-of-homogenous-substrings "Count Number of Homogenous Substrings") +                 +[Next >](../minimum-degree-of-a-connected-trio-in-a-graph "Minimum Degree of a Connected Trio in a Graph") + +## [1760. Minimum Limit of Balls in a Bag (Medium)](https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag "袋子里最少数目的球") + +

    You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations.

    + +

    You can perform the following operation at most maxOperations times:

    + + + +

    Your penalty is the maximum number of balls in a bag. You want to minimize your penalty after the operations.

    + +

    Return the minimum possible penalty after performing the operations.

    + +

     

    +

    Example 1:

    + +
    +Input: nums = [9], maxOperations = 2
    +Output: 3
    +Explanation: 
    +- Divide the bag with 9 balls into two bags of sizes 6 and 3. [9] -> [6,3].
    +- Divide the bag with 6 balls into two bags of sizes 3 and 3. [6,3] -> [3,3,3].
    +The bag with the most number of balls has 3 balls, so your penalty is 3 and you should return 3.
    +
    + +

    Example 2:

    + +
    +Input: nums = [2,4,8,2], maxOperations = 4
    +Output: 2
    +Explanation:
    +- Divide the bag with 8 balls into two bags of sizes 4 and 4. [2,4,8,2] -> [2,4,4,4,2].
    +- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,4,4,4,2] -> [2,2,2,4,4,2].
    +- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,4,4,2] -> [2,2,2,2,2,4,2].
    +- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,2,2,4,2] -> [2,2,2,2,2,2,2,2].
    +The bag with the most number of balls has 2 balls, so your penalty is 2 an you should return 2.
    +
    + +

    Example 3:

    + +
    +Input: nums = [7,17], maxOperations = 2
    +Output: 7
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Heap](../../tag/heap/README.md)] + [[Binary Search](../../tag/binary-search/README.md)] + +### Hints +
    +Hint 1 +Let's change the question if we know the maximum size of a bag what is the minimum number of bags you can make +
    + +
    +Hint 2 +note that as the maximum size increases the minimum number of bags decreases so we can binary search the maximum size +
    diff --git a/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md b/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md new file mode 100644 index 000000000..4947d0761 --- /dev/null +++ b/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md @@ -0,0 +1,67 @@ + + + + + + + +[< Previous](../merge-strings-alternately "Merge Strings Alternately") +                 +[Next >](../maximum-score-from-performing-multiplication-operations "Maximum Score from Performing Multiplication Operations") + +## [1769. Minimum Number of Operations to Move All Balls to Each Box (Medium)](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box "移动所有球到每个盒子所需的最小操作数") + +

    You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empty, and '1' if it contains one ball.

    + +

    In one operation, you can move one ball from a box to an adjacent box. Box i is adjacent to box j if abs(i - j) == 1. Note that after doing so, there may be more than one ball in some boxes.

    + +

    Return an array answer of size n, where answer[i] is the minimum number of operations needed to move all the balls to the ith box.

    + +

    Each answer[i] is calculated considering the initial state of the boxes.

    + +

     

    +

    Example 1:

    + +
    +Input: boxes = "110"
    +Output: [1,1,3]
    +Explanation: The answer for each box is as follows:
    +1) First box: you will have to move one ball from the second box to the first box in one operation.
    +2) Second box: you will have to move one ball from the first box to the second box in one operation.
    +3) Third box: you will have to move one ball from the first box to the third box in two operations, and move one ball from the second box to the third box in one operation.
    +
    + +

    Example 2:

    + +
    +Input: boxes = "001011"
    +Output: [11,8,5,4,3,4]
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Greedy](../../tag/greedy/README.md)] + [[Array](../../tag/array/README.md)] + +### Hints +
    +Hint 1 +If you want to move a ball from box i to box j, you'll need abs(i-j) moves. +
    + +
    +Hint 2 +To move all balls to some box, you can move them one by one. +
    + +
    +Hint 3 +For each box i, iterate on each ball in a box j, and add abs(i-j) to answers[i]. +
    diff --git a/problems/minimum-unique-word-abbreviation/README.md b/problems/minimum-unique-word-abbreviation/README.md index 26b1ecb05..355b569bb 100644 --- a/problems/minimum-unique-word-abbreviation/README.md +++ b/problems/minimum-unique-word-abbreviation/README.md @@ -9,7 +9,7 @@                  [Next >](../fizz-buzz "Fizz Buzz") -## [411. Minimum Unique Word Abbreviation (Hard)](https://leetcode.com/problems/minimum-unique-word-abbreviation "最短特异单词缩写") +## [411. Minimum Unique Word Abbreviation (Hard)](https://leetcode.com/problems/minimum-unique-word-abbreviation "最短独占单词缩写")

    A string such as "word" contains the following abbreviations:

    diff --git a/problems/number-of-1-bits/README.md b/problems/number-of-1-bits/README.md index 3332909f4..5732c15d0 100644 --- a/problems/number-of-1-bits/README.md +++ b/problems/number-of-1-bits/README.md @@ -11,17 +11,15 @@ ## [191. Number of 1 Bits (Easy)](https://leetcode.com/problems/number-of-1-bits "位1的个数") -

    Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

    +

    Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

    Note:

    -

    Follow up: If this function is called many times, how would you optimize it?

    -

     

    Example 1:

    @@ -54,6 +52,9 @@
  • The input must be a binary string of length 32
  • +

     

    +Follow up: If this function is called many times, how would you optimize it? + ### Related Topics [[Bit Manipulation](../../tag/bit-manipulation/README.md)] diff --git a/problems/number-of-enclaves/README.md b/problems/number-of-enclaves/README.md index e578da4be..8efe7a5cf 100644 --- a/problems/number-of-enclaves/README.md +++ b/problems/number-of-enclaves/README.md @@ -11,41 +11,38 @@ ## [1020. Number of Enclaves (Medium)](https://leetcode.com/problems/number-of-enclaves "飞地的数量") -

    Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land)

    +

    You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.

    -

    A move consists of walking from one land square 4-directionally to another land square, or off the boundary of the grid.

    +

    A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.

    -

    Return the number of land squares in the grid for which we cannot walk off the boundary of the grid in any number of moves.

    +

    Return the number of land cells in grid for which we cannot walk off the boundary of the grid in any number of moves.

     

    -

    Example 1:

    - +
    -Input: [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]]
    -Output: 3
    -Explanation: 
    -There are three 1s that are enclosed by 0s, and one 1 that isn't enclosed because its on the boundary.
    +Input: grid = [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]] +Output: 3 +Explanation: There are three 1s that are enclosed by 0s, and one 1 that is not enclosed because its on the boundary. +

    Example 2:

    - +
    -Input: [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]
    -Output: 0
    -Explanation: 
    -All 1s are either on the boundary or can reach the boundary.
    +Input: grid = [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]
    +Output: 0
    +Explanation: All 1s are either on the boundary or can reach the boundary.
     

     

    - -

    Note:

    - -
      -
    1. 1 <= A.length <= 500
    2. -
    3. 1 <= A[i].length <= 500
    4. -
    5. 0 <= A[i][j] <= 1
    6. -
    7. All rows have the same size.
    8. -
    +

    Constraints:

    + + ### Related Topics [[Depth-first Search](../../tag/depth-first-search/README.md)] diff --git a/problems/pascals-triangle-ii/README.md b/problems/pascals-triangle-ii/README.md index eb483e16c..485894bde 100644 --- a/problems/pascals-triangle-ii/README.md +++ b/problems/pascals-triangle-ii/README.md @@ -11,17 +11,10 @@ ## [119. Pascal's Triangle II (Easy)](https://leetcode.com/problems/pascals-triangle-ii "杨辉三角 II") -

    Given an integer rowIndex, return the rowIndexth row of the Pascal's triangle.

    - -

    Notice that the row index starts from 0.

    - -


    -In Pascal's triangle, each number is the sum of the two numbers directly above it.

    - -

    Follow up:

    - -

    Could you optimize your algorithm to use only O(k) extra space?

    +

    Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.

    +

    In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

    +

     

    Example 1:

    Input: rowIndex = 3
    @@ -37,9 +30,12 @@
     

    Constraints:

    +

     

    +

    Follow up: Could you optimize your algorithm to use only O(rowIndex) extra space?

    + ### Related Topics [[Array](../../tag/array/README.md)] diff --git a/problems/pascals-triangle/README.md b/problems/pascals-triangle/README.md index 2ef0d3e30..05cfa20e7 100644 --- a/problems/pascals-triangle/README.md +++ b/problems/pascals-triangle/README.md @@ -11,24 +11,24 @@ ## [118. Pascal's Triangle (Easy)](https://leetcode.com/problems/pascals-triangle "杨辉三角") -

    Given a non-negative integer numRows, generate the first numRows of Pascal's triangle.

    - -


    -In Pascal's triangle, each number is the sum of the two numbers directly above it.

    - -

    Example:

    - -
    -Input: 5
    -Output:
    -[
    -     [1],
    -    [1,1],
    -   [1,2,1],
    -  [1,3,3,1],
    - [1,4,6,4,1]
    -]
    +

    Given an integer numRows, return the first numRows of Pascal's triangle.

    + +

    In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

    + +

     

    +

    Example 1:

    +
    Input: numRows = 5
    +Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
    +

    Example 2:

    +
    Input: numRows = 1
    +Output: [[1]]
     
    +

     

    +

    Constraints:

    + +
      +
    • 1 <= numRows <= 30
    • +
    ### Related Topics [[Array](../../tag/array/README.md)] diff --git a/problems/path-sum-iv/README.md b/problems/path-sum-iv/README.md index 4dbe3461f..3218705e0 100644 --- a/problems/path-sum-iv/README.md +++ b/problems/path-sum-iv/README.md @@ -9,7 +9,7 @@                  [Next >](../beautiful-arrangement-ii "Beautiful Arrangement II") -## [666. Path Sum IV (Medium)](https://leetcode.com/problems/path-sum-iv "路径和 IV") +## [666. Path Sum IV (Medium)](https://leetcode.com/problems/path-sum-iv "路径总和 IV")

    If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers.

    diff --git a/problems/peeking-iterator/README.md b/problems/peeking-iterator/README.md index 62371eb61..19c92cdea 100644 --- a/problems/peeking-iterator/README.md +++ b/problems/peeking-iterator/README.md @@ -11,20 +11,48 @@ ## [284. Peeking Iterator (Medium)](https://leetcode.com/problems/peeking-iterator "顶端迭代器") -

    Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essentially peek() at the element that will be returned by the next call to next().

    +

    Design an iterator that supports the peek operation on a list in addition to the hasNext and the next operations.

    -

    Example:

    +

    Implement the PeekingIterator class:

    + +
      +
    • PeekingIterator(int[] nums) Initializes the object with the given integer array nums.
    • +
    • int next() Returns the next element in the array and moves the pointer to the next element.
    • +
    • bool hasNext() Returns true if there are still elements in the array.
    • +
    • int peek() Returns the next element in the array without moving the pointer.
    • +
    + +

     

    +

    Example 1:

    -Assume that the iterator is initialized to the beginning of the list: [1,2,3].
    +Input
    +["PeekingIterator", "next", "peek", "next", "next", "hasNext"]
    +[[[1, 2, 3]], [], [], [], [], []]
    +Output
    +[null, 1, 2, 2, 3, false]
     
    -Call next() gets you 1, the first element in the list.
    -Now you call peek() and it returns 2, the next element. Calling next() after that still return 2. 
    -You call next() the final time and it returns 3, the last element. 
    -Calling hasNext() after that should return false.
    +Explanation
    +PeekingIterator peekingIterator = new PeekingIterator([1, 2, 3]); // [1,2,3]
    +peekingIterator.next();    // return 1, the pointer moves to the next element [1,2,3].
    +peekingIterator.peek();    // return 2, the pointer does not move [1,2,3].
    +peekingIterator.next();    // return 2, the pointer moves to the next element [1,2,3]
    +peekingIterator.next();    // return 3, the pointer moves to the next element [1,2,3]
    +peekingIterator.hasNext(); // return False
     
    -

    Follow up: How would you extend your design to be generic and work with all types, not just integer?

    +

     

    +

    Constraints:

    + +
      +
    • 1 <= nums.length <= 1000
    • +
    • 1 <= nums[i] <= 1000
    • +
    • All the calls to next and peek are valid.
    • +
    • At most 1000 calls will be made to next, hasNext, and peek.
    • +
    + +

     

    +Follow up: How would you extend your design to be generic and work with all types, not just integer? ### Related Topics [[Design](../../tag/design/README.md)] diff --git a/problems/preimage-size-of-factorial-zeroes-function/README.md b/problems/preimage-size-of-factorial-zeroes-function/README.md index 782d598d5..2362656ce 100644 --- a/problems/preimage-size-of-factorial-zeroes-function/README.md +++ b/problems/preimage-size-of-factorial-zeroes-function/README.md @@ -9,7 +9,7 @@                  [Next >](../valid-tic-tac-toe-state "Valid Tic-Tac-Toe State") -## [793. Preimage Size of Factorial Zeroes Function (Hard)](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function "阶乘函数后K个零") +## [793. Preimage Size of Factorial Zeroes Function (Hard)](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function "阶乘函数后 K 个零")

    Let f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * 3 * ... * x, and by convention, 0! = 1.)

    diff --git a/problems/recyclable-and-low-fat-products/README.md b/problems/recyclable-and-low-fat-products/README.md new file mode 100644 index 000000000..d591b2303 --- /dev/null +++ b/problems/recyclable-and-low-fat-products/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< Previous](../design-most-recently-used-queue "Design Most Recently Used Queue") +                 +[Next >](../minimum-changes-to-make-alternating-binary-string "Minimum Changes To Make Alternating Binary String") + +## [1757. Recyclable and Low Fat Products (Easy)](https://leetcode.com/problems/recyclable-and-low-fat-products "") + + diff --git a/problems/recyclable-and-low-fat-products/mysql_schemas.sql b/problems/recyclable-and-low-fat-products/mysql_schemas.sql new file mode 100644 index 000000000..bffc7a5fb --- /dev/null +++ b/problems/recyclable-and-low-fat-products/mysql_schemas.sql @@ -0,0 +1,7 @@ +Create table If Not Exists Products (product_id int, low_fats ENUM('Y', 'N'), recyclable ENUM('Y','N')); +Truncate table Products; +insert into Products (product_id, low_fats, recyclable) values ('0', 'Y', 'N'); +insert into Products (product_id, low_fats, recyclable) values ('1', 'Y', 'Y'); +insert into Products (product_id, low_fats, recyclable) values ('2', 'N', 'Y'); +insert into Products (product_id, low_fats, recyclable) values ('3', 'Y', 'Y'); +insert into Products (product_id, low_fats, recyclable) values ('4', 'N', 'N'); diff --git a/problems/relative-ranks/README.md b/problems/relative-ranks/README.md index ab21ccd9a..4e61c6bbc 100644 --- a/problems/relative-ranks/README.md +++ b/problems/relative-ranks/README.md @@ -11,20 +11,42 @@ ## [506. Relative Ranks (Easy)](https://leetcode.com/problems/relative-ranks "相对名次") -

    -Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal".

    +

    You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.

    + +

    The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2nd highest score, and so on. The placement of each athlete determines their rank:

    + +
      +
    • The 1st place athlete's rank is "Gold Medal".
    • +
    • The 2nd place athlete's rank is "Silver Medal".
    • +
    • The 3rd place athlete's rank is "Bronze Medal".
    • +
    • For the 4th place to the nth place athlete, their rank is their placement number (i.e., the xth place athlete's rank is "x").
    • +
    + +

    Return an array answer of size n where answer[i] is the rank of the ith athlete.

    + +

     

    +

    Example 1:

    + +
    +Input: score = [5,4,3,2,1]
    +Output: ["Gold Medal","Silver Medal","Bronze Medal","4","5"]
    +Explanation: The placements are [1st, 2nd, 3rd, 4th, 5th].
    + +

    Example 2:

    -

    Example 1:

    -Input: [5, 4, 3, 2, 1]
    -Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"]
    -Explanation: The first three athletes got the top three highest scores, so they got "Gold Medal", "Silver Medal" and "Bronze Medal". 
    For the left two athletes, you just need to output their relative ranks according to their scores. +Input: score = [10,3,8,9,4] +Output: ["Gold Medal","5","Bronze Medal","Silver Medal","4"] +Explanation: The placements are [1st, 5th, 3rd, 2nd, 4th]. +
    -

    - -

    Note:
    -

      -
    1. N is a positive integer and won't exceed 10,000.
    2. -
    3. All the scores of athletes are guaranteed to be unique.
    4. -
    -

    + +

     

    +

    Constraints:

    + +
      +
    • n == score.length
    • +
    • 1 <= n <= 104
    • +
    • 0 <= score[i] <= 106
    • +
    • All the values in score are unique.
    • +
    diff --git a/problems/repeated-substring-pattern/README.md b/problems/repeated-substring-pattern/README.md index 0f8fa3f30..d5cf1a1d3 100644 --- a/problems/repeated-substring-pattern/README.md +++ b/problems/repeated-substring-pattern/README.md @@ -11,33 +11,40 @@ ## [459. Repeated Substring Pattern (Easy)](https://leetcode.com/problems/repeated-substring-pattern "重复的子字符串") -

    Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 10000.

    +

    Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.

     

    - -

    Example 1:

    +

    Example 1:

    -Input: "abab"
    -Output: True
    -Explanation: It's the substring "ab" twice.
    +Input: s = "abab"
    +Output: true
    +Explanation: It is the substring "ab" twice.
     
    -

    Example 2:

    +

    Example 2:

    -Input: "aba"
    -Output: False
    +Input: s = "aba"
    +Output: false
     
    -

    Example 3:

    +

    Example 3:

    -Input: "abcabcabcabc"
    -Output: True
    -Explanation: It's the substring "abc" four times. (And the substring "abcabc" twice.)
    +Input: s = "abcabcabcabc"
    +Output: true
    +Explanation: It is the substring "abc" four times or the substring "abcabc" twice.
     
    +

     

    +

    Constraints:

    + +
      +
    • 1 <= s.length <= 104
    • +
    • s consists of lowercase English letters.
    • +
    + ### Related Topics [[String](../../tag/string/README.md)] diff --git a/problems/restore-ip-addresses/README.md b/problems/restore-ip-addresses/README.md index 8dfc24cfc..cb6a583eb 100644 --- a/problems/restore-ip-addresses/README.md +++ b/problems/restore-ip-addresses/README.md @@ -9,7 +9,7 @@                  [Next >](../binary-tree-inorder-traversal "Binary Tree Inorder Traversal") -## [93. Restore IP Addresses (Medium)](https://leetcode.com/problems/restore-ip-addresses "复原IP地址") +## [93. Restore IP Addresses (Medium)](https://leetcode.com/problems/restore-ip-addresses "复原 IP 地址")

    Given a string s containing only digits, return all possible valid IP addresses that can be obtained from s. You can return them in any order.

    diff --git a/problems/reverse-linked-list-ii/README.md b/problems/reverse-linked-list-ii/README.md index 9e99a57a2..e348ad947 100644 --- a/problems/reverse-linked-list-ii/README.md +++ b/problems/reverse-linked-list-ii/README.md @@ -11,17 +11,36 @@ ## [92. Reverse Linked List II (Medium)](https://leetcode.com/problems/reverse-linked-list-ii "反转链表 II") -

    Reverse a linked list from position m to n. Do it in one-pass.

    +

    Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.

    -

    Note: 1 ≤ mn ≤ length of list.

    +

     

    +

    Example 1:

    + +
    +Input: head = [1,2,3,4,5], left = 2, right = 4
    +Output: [1,4,3,2,5]
    +
    -

    Example:

    +

    Example 2:

    -Input: 1->2->3->4->5->NULL, m = 2, n = 4
    -Output: 1->4->3->2->5->NULL
    +Input: head = [5], left = 1, right = 1
    +Output: [5]
     
    +

     

    +

    Constraints:

    + +
      +
    • The number of nodes in the list is n.
    • +
    • 1 <= n <= 500
    • +
    • -500 <= Node.val <= 500
    • +
    • 1 <= left <= right <= n
    • +
    + +

     

    +Follow up: Could you do it in one pass? + ### Related Topics [[Linked List](../../tag/linked-list/README.md)] diff --git a/problems/reverse-linked-list/README.md b/problems/reverse-linked-list/README.md index 932df0fe5..d03c625ab 100644 --- a/problems/reverse-linked-list/README.md +++ b/problems/reverse-linked-list/README.md @@ -11,18 +11,40 @@ ## [206. Reverse Linked List (Easy)](https://leetcode.com/problems/reverse-linked-list "反转链表") -

    Reverse a singly linked list.

    +

    Given the head of a singly linked list, reverse the list, and return the reversed list.

    -

    Example:

    +

     

    +

    Example 1:

    + +
    +Input: head = [1,2,3,4,5]
    +Output: [5,4,3,2,1]
    +
    +

    Example 2:

    +
    -Input: 1->2->3->4->5->NULL
    -Output: 5->4->3->2->1->NULL
    +Input: head = [1,2]
    +Output: [2,1]
     
    -

    Follow up:

    +

    Example 3:

    + +
    +Input: head = []
    +Output: []
    +
    + +

     

    +

    Constraints:

    + +
      +
    • The number of nodes in the list is the range [0, 5000].
    • +
    • -5000 <= Node.val <= 5000
    • +
    -

    A linked list can be reversed either iteratively or recursively. Could you implement both?

    +

     

    +

    Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?

    ### Related Topics [[Linked List](../../tag/linked-list/README.md)] diff --git a/problems/roman-to-integer/README.md b/problems/roman-to-integer/README.md index 595718a95..a8386bbd3 100644 --- a/problems/roman-to-integer/README.md +++ b/problems/roman-to-integer/README.md @@ -92,19 +92,5 @@ M 1000
    ### Hints
    Hint 1 -I - 1
    -V - 5
    -X - 10
    -L - 50
    -C - 100
    -D - 500
    -M - 1000
    -
    - -
    -Hint 2 -Rules:
    -* If I comes before V or X, subtract 1 eg: IV = 4 and IX = 9
    -* If X comes before L or C, subtract 10 eg: XL = 40 and XC = 90
    -* If C comes before D or M, subtract 100 eg: CD = 400 and CM = 900
    +Problem is simpler to solve by working the string from back to front and using a map.
    diff --git a/problems/search-in-rotated-sorted-array-ii/README.md b/problems/search-in-rotated-sorted-array-ii/README.md index d61592cd3..c1d27b58c 100644 --- a/problems/search-in-rotated-sorted-array-ii/README.md +++ b/problems/search-in-rotated-sorted-array-ii/README.md @@ -11,11 +11,11 @@ ## [81. Search in Rotated Sorted Array II (Medium)](https://leetcode.com/problems/search-in-rotated-sorted-array-ii "搜索旋转排序数组 II") -

    You are given an integer array nums sorted in ascending order (not necessarily distinct values), and an integer target.

    +

    There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).

    -

    Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,4,4,5,6,6,7] might become [4,5,6,6,7,0,1,2,4,4]).

    +

    Before being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,4,4,5,6,6,7] might be rotated at pivot index 5 and become [4,5,6,6,7,0,1,2,4,4].

    -

    If target is found in the array return its index, otherwise, return -1.

    +

    Given the array nums after the rotation and an integer target, return true if target is in nums, or false if it is not in nums.

     

    Example 1:

    @@ -36,7 +36,7 @@

     

    -Follow up: This problem is the same as Search in Rotated Sorted Array, where nums may contain duplicates. Would this affect the run-time complexity? How and why? +Follow up: This problem is the same as Search in Rotated Sorted Array, where nums may contain duplicates. Would this affect the runtime complexity? How and why? ### Related Topics [[Array](../../tag/array/README.md)] diff --git a/problems/search-in-rotated-sorted-array/README.md b/problems/search-in-rotated-sorted-array/README.md index e6d7c8e89..b299214e8 100644 --- a/problems/search-in-rotated-sorted-array/README.md +++ b/problems/search-in-rotated-sorted-array/README.md @@ -11,11 +11,11 @@ ## [33. Search in Rotated Sorted Array (Medium)](https://leetcode.com/problems/search-in-rotated-sorted-array "搜索旋转排序数组") -

    You are given an integer array nums sorted in ascending order (with distinct values), and an integer target.

    +

    There is an integer array nums sorted in ascending order (with distinct values).

    -

    Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).

    +

    Prior to being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].

    -

    If target is found in the array return its index, otherwise, return -1.

    +

    Given the array nums after the rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

     

    Example 1:

    @@ -39,6 +39,9 @@
  • -104 <= target <= 104
  • +

     

    +Follow up: Can you achieve this in O(log n) time complexity? + ### Related Topics [[Array](../../tag/array/README.md)] [[Binary Search](../../tag/binary-search/README.md)] diff --git a/problems/shortest-distance-to-a-character/README.md b/problems/shortest-distance-to-a-character/README.md index bebafa834..0406ae171 100644 --- a/problems/shortest-distance-to-a-character/README.md +++ b/problems/shortest-distance-to-a-character/README.md @@ -11,21 +11,35 @@ ## [821. Shortest Distance to a Character (Easy)](https://leetcode.com/problems/shortest-distance-to-a-character "字符的最短距离") -

    Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the shortest distance from s[i] to the character c in s.

    +

    Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the distance from index i to the closest occurrence of character c in s.

    + +

    The distance between two indices i and j is abs(i - j), where abs is the absolute value function.

     

    Example 1:

    -
    Input: s = "loveleetcode", c = "e"
    +
    +
    +Input: s = "loveleetcode", c = "e"
     Output: [3,2,1,0,1,0,0,1,2,2,1,0]
    -

    Example 2:

    -
    Input: s = "aaab", c = "b"
    +Explanation: The character 'e' appears at indices 3, 5, 6, and 11 (0-indexed).
    +The closest occurrence of 'e' for index 0 is at index 3, so the distance is abs(0 - 3) = 3.
    +The closest occurrence of 'e' for index 1 is at index 3, so the distance is abs(1 - 3) = 3.
    +For index 4, there is a tie between the 'e' at index 3 and the 'e' at index 5, but the distance is still the same: abs(4 - 3) == abs(4 - 5) = 1.
    +The closest occurrence of 'e' for index 8 is at index 6, so the distance is abs(8 - 6) = 2.
    +
    + +

    Example 2:

    + +
    +Input: s = "aaab", c = "b"
     Output: [3,2,1,0]
     
    +

     

    Constraints:

    • 1 <= s.length <= 104
    • s[i] and c are lowercase English letters.
    • -
    • c occurs at least once in s.
    • +
    • It is guaranteed that c occurs at least once in s.
    diff --git a/problems/shortest-path-in-binary-matrix/README.md b/problems/shortest-path-in-binary-matrix/README.md index aa9ac7b98..2ebb3f0e8 100644 --- a/problems/shortest-path-in-binary-matrix/README.md +++ b/problems/shortest-path-in-binary-matrix/README.md @@ -11,51 +11,48 @@ ## [1091. Shortest Path in Binary Matrix (Medium)](https://leetcode.com/problems/shortest-path-in-binary-matrix "二进制矩阵中的最短路径") -

    In an N by N square grid, each cell is either empty (0) or blocked (1).

    +

    Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.

    -

    clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that:

    +

    A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:

      -
    • Adjacent cells C_i and C_{i+1} are connected 8-directionally (ie., they are different and share an edge or corner)
    • -
    • C_1 is at location (0, 0) (ie. has value grid[0][0])
    • -
    • C_k is at location (N-1, N-1) (ie. has value grid[N-1][N-1])
    • -
    • If C_i is located at (r, c), then grid[r][c] is empty (ie. grid[r][c] == 0).
    • +
    • All the visited cells of the path are 0.
    • +
    • All the adjacent cells of the path are 8-directionally connected (i.e., they are different and they share an edge or a corner).
    -

    Return the length of the shortest such clear path from top-left to bottom-right.  If such a path does not exist, return -1.

    +

    The length of a clear path is the number of visited cells of this path.

     

    -

    Example 1:

    - +
    -Input: [[0,1],[1,0]]
    -
    -
    -Output: 2
    -
    +Input: grid = [[0,1],[1,0]]
    +Output: 2
     
    -

    Example 2:

    - +
    -Input: [[0,0,0],[1,1,0],[1,1,0]]
    -
    -
    +Input: grid = [[0,0,0],[1,1,0],[1,1,0]]
     Output: 4
    -
     
    -

     

    -
    +

    Example 3:

    + +
    +Input: grid = [[1,0,0],[1,1,0],[1,1,0]]
    +Output: -1
    +
    -

    Note:

    +

     

    +

    Constraints:

    -
      -
    1. 1 <= grid.length == grid[0].length <= 100
    2. -
    3. grid[r][c] is 0 or 1
    4. -
    +
      +
    • n == grid.length
    • +
    • n == grid[i].length
    • +
    • 1 <= n <= 100
    • +
    • grid[i][j] is 0 or 1
    • +
    ### Related Topics [[Breadth-first Search](../../tag/breadth-first-search/README.md)] diff --git a/problems/split-array-into-consecutive-subsequences/README.md b/problems/split-array-into-consecutive-subsequences/README.md index 9fb907bfb..a54202f42 100644 --- a/problems/split-array-into-consecutive-subsequences/README.md +++ b/problems/split-array-into-consecutive-subsequences/README.md @@ -11,49 +11,47 @@ ## [659. Split Array into Consecutive Subsequences (Medium)](https://leetcode.com/problems/split-array-into-consecutive-subsequences "分割数组为连续子序列") -

    Given an array nums sorted in ascending order, return true if and only if you can split it into 1 or more subsequences such that each subsequence consists of consecutive integers and has length at least 3.

    +

    Given an integer array nums that is sorted in ascending order, return true if and only if you can split it into one or more subsequences such that each subsequence consists of consecutive integers and has a length of at least 3.

     

    - -

    Example 1:

    +

    Example 1:

    -Input: [1,2,3,3,4,5]
    -Output: True
    +Input: nums = [1,2,3,3,4,5]
    +Output: true
     Explanation:
     You can split them into two consecutive subsequences : 
     1, 2, 3
     3, 4, 5
     
    -

    Example 2:

    +

    Example 2:

    -Input: [1,2,3,3,4,4,5,5]
    -Output: True
    +Input: nums = [1,2,3,3,4,4,5,5]
    +Output: true
     Explanation:
     You can split them into two consecutive subsequences : 
     1, 2, 3, 4, 5
     3, 4, 5
     
    -

    Example 3:

    +

    Example 3:

    -Input: [1,2,3,4,4,5]
    -Output: False
    +Input: nums = [1,2,3,4,4,5]
    +Output: false
     

     

    - -

    Constraints:

    +

    Constraints:

      -
    • 1 <= nums.length <= 10000
    • +
    • 1 <= nums.length <= 104
    • +
    • -1000 <= nums[i] <= 1000
    • +
    • nums is sorted in an ascending order.
    -

     

    - ### Related Topics [[Heap](../../tag/heap/README.md)] [[Greedy](../../tag/greedy/README.md)] diff --git a/problems/sum-of-unique-elements/README.md b/problems/sum-of-unique-elements/README.md new file mode 100644 index 000000000..067d9813a --- /dev/null +++ b/problems/sum-of-unique-elements/README.md @@ -0,0 +1,59 @@ + + + + + + + +[< Previous](../leetflex-banned-accounts "Leetflex Banned Accounts") +                 +[Next >](../maximum-absolute-sum-of-any-subarray "Maximum Absolute Sum of Any Subarray") + +## [1748. Sum of Unique Elements (Easy)](https://leetcode.com/problems/sum-of-unique-elements "唯一元素的和") + +

    You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in the array.

    + +

    Return the sum of all the unique elements of nums.

    + +

     

    +

    Example 1:

    + +
    +Input: nums = [1,2,3,2]
    +Output: 4
    +Explanation: The unique elements are [1,3], and the sum is 4.
    +
    + +

    Example 2:

    + +
    +Input: nums = [1,1,1,1,1]
    +Output: 0
    +Explanation: There are no unique elements, and the sum is 0.
    +
    + +

    Example 3:

    + +
    +Input: nums = [1,2,3,4,5]
    +Output: 15
    +Explanation: The unique elements are [1,2,3,4,5], and the sum is 15.
    +
    + +

     

    +

    Constraints:

    + +
      +
    • 1 <= nums.length <= 100
    • +
    • 1 <= nums[i] <= 100
    • +
    + +### Related Topics + [[Array](../../tag/array/README.md)] + [[Hash Table](../../tag/hash-table/README.md)] + +### Hints +
    +Hint 1 +Use a dictionary to count the frequency of each number. +
    diff --git a/problems/sum-root-to-leaf-numbers/README.md b/problems/sum-root-to-leaf-numbers/README.md index b6da1efa5..f5f8ef2f9 100644 --- a/problems/sum-root-to-leaf-numbers/README.md +++ b/problems/sum-root-to-leaf-numbers/README.md @@ -11,42 +11,50 @@ ## [129. Sum Root to Leaf Numbers (Medium)](https://leetcode.com/problems/sum-root-to-leaf-numbers "求根到叶子节点数字之和") -

    Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.

    +

    You are given the root of a binary tree containing digits from 0 to 9 only.

    -

    An example is the root-to-leaf path 1->2->3 which represents the number 123.

    +

    Each root-to-leaf path in the tree represents a number.

    -

    Find the total sum of all root-to-leaf numbers.

    +
      +
    • For example, the root-to-leaf path 1 -> 2 -> 3 represents the number 123.
    • +
    -

    Note: A leaf is a node with no children.

    +

    Return the total sum of all root-to-leaf numbers.

    -

    Example:

    +

    A leaf node is a node with no children.

    +

     

    +

    Example 1:

    +
    -Input: [1,2,3]
    -    1
    -   / \
    -  2   3
    +Input: root = [1,2,3]
     Output: 25
     Explanation:
     The root-to-leaf path 1->2 represents the number 12.
     The root-to-leaf path 1->3 represents the number 13.
    -Therefore, sum = 12 + 13 = 25.
    +Therefore, sum = 12 + 13 = 25. +

    Example 2:

    - +
    -Input: [4,9,0,5,1]
    -    4
    -   / \
    -  9   0
    - / \
    -5   1
    +Input: root = [4,9,0,5,1]
     Output: 1026
     Explanation:
     The root-to-leaf path 4->9->5 represents the number 495.
     The root-to-leaf path 4->9->1 represents the number 491.
     The root-to-leaf path 4->0 represents the number 40.
    -Therefore, sum = 495 + 491 + 40 = 1026.
    +Therefore, sum = 495 + 491 + 40 = 1026. +
    + +

     

    +

    Constraints:

    + + ### Related Topics [[Tree](../../tag/tree/README.md)] diff --git a/problems/surrounded-regions/README.md b/problems/surrounded-regions/README.md index 0a565a22b..f0434e8fd 100644 --- a/problems/surrounded-regions/README.md +++ b/problems/surrounded-regions/README.md @@ -11,31 +11,35 @@ ## [130. Surrounded Regions (Medium)](https://leetcode.com/problems/surrounded-regions "被围绕的区域") -

    Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.

    +

    Given an m x n matrix board containing 'X' and 'O', capture all regions surrounded by 'X'.

    -

    A region is captured by flipping all 'O's into 'X's in that surrounded region.

    - -

    Example:

    +

    A region is captured by flipping all 'O's into 'X's in that surrounded region.

    +

     

    +

    Example 1:

    +
    -X X X X
    -X O O X
    -X X O X
    -X O X X
    +Input: board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
    +Output: [["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
    +Explanation: Surrounded regions should not be on the border, which means that any 'O' on the border of the board are not flipped to 'X'. Any 'O' that is not on the border and it is not connected to an 'O' on the border will be flipped to 'X'. Two cells are connected if they are adjacent cells connected horizontally or vertically.
     
    -

    After running your function, the board should be:

    +

    Example 2:

    -X X X X
    -X X X X
    -X X X X
    -X O X X
    +Input: board = [["X"]]
    +Output: [["X"]]
     
    -

    Explanation:

    +

     

    +

    Constraints:

    -

    Surrounded regions shouldn’t be on the border, which means that any 'O' on the border of the board are not flipped to 'X'. Any 'O' that is not on the border and it is not connected to an 'O' on the border will be flipped to 'X'. Two cells are connected if they are adjacent cells connected horizontally or vertically.

    + ### Related Topics [[Depth-first Search](../../tag/depth-first-search/README.md)] diff --git a/problems/swap-salary/README.md b/problems/swap-salary/README.md index 3fc6f3824..f9e7f212c 100644 --- a/problems/swap-salary/README.md +++ b/problems/swap-salary/README.md @@ -11,29 +11,52 @@ ## [627. Swap Salary (Easy)](https://leetcode.com/problems/swap-salary "变更性别") -

    Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update statement and no intermediate temp table.

    +

    Table: Salary

    -

    Note that you must write a single update statement, DO NOT write any select statement for this problem.

    +
    ++-------------+----------+
    +| Column Name | Type     |
    ++-------------+----------+
    +| id          | int      |
    +| name        | varchar  |
    +| sex         | ENUM     |
    +| salary      | int      |
    ++-------------+----------+
    +id is the primary key for this table.
    +The sex column is ENUM value of type ('m', 'f').
    +The table contains information about an employee.
    +

     

    -

    Example:

    +

    Write an SQL query to swap all 'f' and 'm' values (i.e., change all 'f' values to 'm' and vice versa) with a single update statement and no intermediate temp table(s).

    + +

    Note that you must write a single update statement, DO NOT write any select statement for this problem.

    + +

    The query result format is in the following example:

    + +

     

    +Salary table:
    ++----+------+-----+--------+
     | id | name | sex | salary |
    -|----|------|-----|--------|
    ++----+------+-----+--------+
     | 1  | A    | m   | 2500   |
     | 2  | B    | f   | 1500   |
     | 3  | C    | m   | 5500   |
     | 4  | D    | f   | 500    |
    -
    -After running your update statement, the above salary table should have the following rows: ++----+------+-----+--------+ -
    +Result table:
    ++----+------+-----+--------+
     | id | name | sex | salary |
    -|----|------|-----|--------|
    ++----+------+-----+--------+
     | 1  | A    | f   | 2500   |
     | 2  | B    | m   | 1500   |
     | 3  | C    | f   | 5500   |
     | 4  | D    | m   | 500    |
    ++----+------+-----+--------+
    +(1, A) and (2, C) were changed from 'm' to 'f'.
    +(2, B) and (4, D) were changed from 'f' to 'm'.
     
    diff --git a/problems/symmetric-tree/README.md b/problems/symmetric-tree/README.md index 31daa7e32..b63ee43fe 100644 --- a/problems/symmetric-tree/README.md +++ b/problems/symmetric-tree/README.md @@ -11,33 +11,33 @@ ## [101. Symmetric Tree (Easy)](https://leetcode.com/problems/symmetric-tree "对称二叉树") -

    Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

    - -

    For example, this binary tree [1,2,2,3,4,4,3] is symmetric:

    +

    Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

    +

     

    +

    Example 1:

    +
    -    1
    -   / \
    -  2   2
    - / \ / \
    -3  4 4  3
    +Input: root = [1,2,2,3,4,4,3]
    +Output: true
     
    -

     

    - -

    But the following [1,2,2,null,3,null,3] is not:

    - +

    Example 2:

    +
    -    1
    -   / \
    -  2   2
    -   \   \
    -   3    3
    +Input: root = [1,2,2,null,3,null,3]
    +Output: false
     

     

    +

    Constraints:

    + + -

    Follow up: Solve it both recursively and iteratively.

    +

     

    +Follow up: Could you solve it both recursively and iteratively? ### Related Topics [[Tree](../../tag/tree/README.md)] diff --git a/problems/the-k-weakest-rows-in-a-matrix/README.md b/problems/the-k-weakest-rows-in-a-matrix/README.md index 7ca124453..0ce7840ee 100644 --- a/problems/the-k-weakest-rows-in-a-matrix/README.md +++ b/problems/the-k-weakest-rows-in-a-matrix/README.md @@ -11,9 +11,16 @@ ## [1337. The K Weakest Rows in a Matrix (Easy)](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix "矩阵中战斗力最弱的 K 行") -

    Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest rows in the matrix ordered from the weakest to the strongest.

    +

    You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the civilians. That is, all the 1's will appear to the left of all the 0's in each row.

    -

    A row i is weaker than row j, if the number of soldiers in row i is less than the number of soldiers in row j, or they have the same number of soldiers but i is less than j. Soldiers are always stand in the frontier of a row, that is, always ones may appear first and then zeros.

    +

    A row i is weaker than a row j if one of the following is true:

    + + + +

    Return the indices of the k weakest rows in the matrix ordered from weakest to strongest.

     

    Example 1:

    @@ -28,13 +35,13 @@ k = 3 Output: [2,0,3] Explanation: -The number of soldiers for each row is: -row 0 -> 2 -row 1 -> 4 -row 2 -> 1 -row 3 -> 2 -row 4 -> 5 -Rows ordered from the weakest to the strongest are [2,0,3,1,4] +The number of soldiers in each row is: +- Row 0: 2 +- Row 1: 4 +- Row 2: 1 +- Row 3: 2 +- Row 4: 5 +The rows ordered from weakest to strongest are [2,0,3,1,4].

    Example 2:

    @@ -42,18 +49,18 @@ Rows ordered from the weakest to the strongest are [2,0,3,1,4]
     Input: mat = 
     [[1,0,0,0],
    - [1,1,1,1],
    - [1,0,0,0],
    - [1,0,0,0]], 
    + [1,1,1,1],
    + [1,0,0,0],
    + [1,0,0,0]], 
     k = 2
     Output: [0,2]
     Explanation: 
    -The number of soldiers for each row is: 
    -row 0 -> 1 
    -row 1 -> 4 
    -row 2 -> 1 
    -row 3 -> 1 
    -Rows ordered from the weakest to the strongest are [0,2,3,1]
    +The number of soldiers in each row is: 
    +- Row 0: 1 
    +- Row 1: 4 
    +- Row 2: 1 
    +- Row 3: 1 
    +The rows ordered from weakest to strongest are [0,2,3,1].
     

     

    @@ -62,9 +69,9 @@ Rows ordered from the weakest to the strongest are [0,2,3,1] ### Related Topics diff --git a/problems/transpose-matrix/README.md b/problems/transpose-matrix/README.md index aaf46fee7..adbc9403d 100644 --- a/problems/transpose-matrix/README.md +++ b/problems/transpose-matrix/README.md @@ -11,41 +11,37 @@ ## [867. Transpose Matrix (Easy)](https://leetcode.com/problems/transpose-matrix "转置矩阵") -

    Given a matrix A, return the transpose of A.

    +

    Given a 2D integer array matrix, return the transpose of matrix.

    -

    The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix.

    +

    The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.

    -
    - +

     

    - -

    Example 1:

    -Input: [[1,2,3],[4,5,6],[7,8,9]]
    -Output: [[1,4,7],[2,5,8],[3,6,9]]
    +Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
    +Output: [[1,4,7],[2,5,8],[3,6,9]]
     
    -

    Example 2:

    -Input: [[1,2,3],[4,5,6]]
    -Output: [[1,4],[2,5],[3,6]]
    +Input: matrix = [[1,2,3],[4,5,6]]
    +Output: [[1,4],[2,5],[3,6]]
     

     

    - -

    Note:

    - -
      -
    1. 1 <= A.length <= 1000
    2. -
    3. 1 <= A[0].length <= 1000
    4. -
    -
    -
    +

    Constraints:

    + + ### Related Topics [[Array](../../tag/array/README.md)] diff --git a/problems/tree-of-coprimes/README.md b/problems/tree-of-coprimes/README.md new file mode 100644 index 000000000..5939557a2 --- /dev/null +++ b/problems/tree-of-coprimes/README.md @@ -0,0 +1,78 @@ + + + + + + + +[< Previous](../map-of-highest-peak "Map of Highest Peak") +                 +[Next >](../find-the-subtasks-that-did-not-execute "Find the Subtasks That Did Not Execute") + +## [1766. Tree of Coprimes (Hard)](https://leetcode.com/problems/tree-of-coprimes "互质树") + +

    There is a tree (i.e., a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. Each node has a value associated with it, and the root of the tree is node 0.

    + +

    To represent this tree, you are given an integer array nums and a 2D array edges. Each nums[i] represents the ith node's value, and each edges[j] = [uj, vj] represents an edge between nodes uj and vj in the tree.

    + +

    Two values x and y are coprime if gcd(x, y) == 1 where gcd(x, y) is the greatest common divisor of x and y.

    + +

    An ancestor of a node i is any other node on the shortest path from node i to the root. A node is not considered an ancestor of itself.

    + +

    Return an array ans of size n, where ans[i] is the closest ancestor to node i such that nums[i] and nums[ans[i]] are coprime, or -1 if there is no such ancestor.

    + +

     

    +

    Example 1:

    + +

    + +
    +Input: nums = [2,3,3,2], edges = [[0,1],[1,2],[1,3]]
    +Output: [-1,0,0,1]
    +Explanation: In the above figure, each node's value is in parentheses.
    +- Node 0 has no coprime ancestors.
    +- Node 1 has only one ancestor, node 0. Their values are coprime (gcd(2,3) == 1).
    +- Node 2 has two ancestors, nodes 1 and 0. Node 1's value is not coprime (gcd(3,3) == 3), but node 0's
    +  value is (gcd(2,3) == 1), so node 0 is the closest valid ancestor.
    +- Node 3 has two ancestors, nodes 1 and 0. It is coprime with node 1 (gcd(3,2) == 1), so node 1 is its
    +  closest valid ancestor.
    +
    + +

    Example 2:

    + +

    + +
    +Input: nums = [5,6,10,2,3,6,15], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]]
    +Output: [-1,0,-1,0,0,0,-1]
    +
    + +

     

    +

    Constraints:

    + + + +### Related Topics + [[Tree](../../tag/tree/README.md)] + [[Depth-first Search](../../tag/depth-first-search/README.md)] + [[Breadth-first Search](../../tag/breadth-first-search/README.md)] + [[Math](../../tag/math/README.md)] + +### Hints +
    +Hint 1 +Note that for a node, it's not optimal to consider two nodes with the same value. +
    + +
    +Hint 2 +Note that the values are small enough for you to iterate over them instead of iterating over the parent nodes. +
    diff --git a/problems/valid-palindrome/README.md b/problems/valid-palindrome/README.md index 46d89f104..c4df1f022 100644 --- a/problems/valid-palindrome/README.md +++ b/problems/valid-palindrome/README.md @@ -11,28 +11,30 @@ ## [125. Valid Palindrome (Easy)](https://leetcode.com/problems/valid-palindrome "验证回文串") -

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

    - -

    Note: For the purpose of this problem, we define empty string as valid palindrome.

    +

    Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

    +

     

    Example 1:

    -Input: "A man, a plan, a canal: Panama"
    +Input: s = "A man, a plan, a canal: Panama"
     Output: true
    +Explanation: "amanaplanacanalpanama" is a palindrome.
     

    Example 2:

    -Input: "race a car"
    +Input: s = "race a car"
     Output: false
    +Explanation: "raceacar" is not a palindrome.
     

     

    Constraints:

    diff --git a/problems/valid-parenthesis-string/README.md b/problems/valid-parenthesis-string/README.md index 86f71797c..93260c4b9 100644 --- a/problems/valid-parenthesis-string/README.md +++ b/problems/valid-parenthesis-string/README.md @@ -11,43 +11,35 @@ ## [678. Valid Parenthesis String (Medium)](https://leetcode.com/problems/valid-parenthesis-string "有效的括号字符串") -

    -Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of a string by these rules: -

      -
    1. Any left parenthesis '(' must have a corresponding right parenthesis ')'.
    2. -
    3. Any right parenthesis ')' must have a corresponding left parenthesis '('.
    4. -
    5. Left parenthesis '(' must go before the corresponding right parenthesis ')'.
    6. -
    7. '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string.
    8. -
    9. An empty string is also valid.
    10. -
    -

    - -

    Example 1:
    -

    -Input: "()"
    -Output: True
    +

    Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid.

    + +

    The following rules define a valid string:

    + + + +

     

    +

    Example 1:

    +
    Input: s = "()"
    +Output: true
    +

    Example 2:

    +
    Input: s = "(*)"
    +Output: true
    +

    Example 3:

    +
    Input: s = "(*))"
    +Output: true
     
    -

    +

     

    +

    Constraints:

    -

    Example 2:
    -

    -Input: "(*)"
    -Output: True
    -
    -

    - -

    Example 3:
    -

    -Input: "(*))"
    -Output: True
    -
    -

    - -

    Note:
    -

      -
    1. The string size will be in the range [1, 100].
    2. -
    -

    + ### Related Topics [[String](../../tag/string/README.md)] diff --git a/problems/validate-binary-tree-nodes/README.md b/problems/validate-binary-tree-nodes/README.md index fe4ac2367..e09236345 100644 --- a/problems/validate-binary-tree-nodes/README.md +++ b/problems/validate-binary-tree-nodes/README.md @@ -11,44 +11,36 @@ ## [1361. Validate Binary Tree Nodes (Medium)](https://leetcode.com/problems/validate-binary-tree-nodes "验证二叉树") -

    You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree.

    +

    You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree.

    -

    If node i has no left child then leftChild[i] will equal -1, similarly for the right child.

    +

    If node i has no left child then leftChild[i] will equal -1, similarly for the right child.

    Note that the nodes have no values and that we only use the node numbers in this problem.

     

    Example 1:

    - -

    - +
     Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,-1,-1,-1]
     Output: true
     

    Example 2:

    - -

    - +
     Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,3,-1,-1]
     Output: false
     

    Example 3:

    - -

    - +
     Input: n = 2, leftChild = [1,0], rightChild = [-1,-1]
     Output: false
     

    Example 4:

    - -

    - +
     Input: n = 6, leftChild = [1,-1,-1,4,-1,-1], rightChild = [2,-1,-1,5,-1,-1]
     Output: false
    @@ -58,7 +50,7 @@
     

    Constraints:

      -
    • 1 <= n <= 10^4
    • +
    • 1 <= n <= 104
    • leftChild.length == rightChild.length == n
    • -1 <= leftChild[i], rightChild[i] <= n - 1
    diff --git a/problems/word-ladder-ii/README.md b/problems/word-ladder-ii/README.md index 89a3a383f..cc6960a6a 100644 --- a/problems/word-ladder-ii/README.md +++ b/problems/word-ladder-ii/README.md @@ -11,52 +11,44 @@ ## [126. Word Ladder II (Hard)](https://leetcode.com/problems/word-ladder-ii "单词接龙 II") -

    Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:

    - -
      -
    1. Only one letter can be changed at a time
    2. -
    3. Each transformed word must exist in the word list. Note that beginWord is not a transformed word.
    4. -
    - -

    Note:

    +

    A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words such that:

      -
    • Return an empty list 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.
    • +
    • The first word in the sequence is beginWord.
    • +
    • The last word in the sequence is endWord.
    • +
    • Only one letter is different between each adjacent pair of words in the sequence.
    • +
    • Every word in the sequence is in wordList.
    +

    Given two words, beginWord and endWord, and a dictionary wordList, return all the shortest transformation sequences from beginWord to endWord, or an empty list if no such sequence exists.

    + +

     

    Example 1:

    -Input:
    -beginWord = "hit",
    -endWord = "cog",
    -wordList = ["hot","dot","dog","lot","log","cog"]
    -
    -Output:
    -[
    -  ["hit","hot","dot","dog","cog"],
    -  ["hit","hot","lot","log","cog"]
    -]
    +Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
    +Output: [["hit","hot","dot","dog","cog"],["hit","hot","lot","log","cog"]]
     

    Example 2:

    -Input:
    -beginWord = "hit"
    -endWord = "cog"
    -wordList = ["hot","dot","dog","lot","log"]
    -
    -Output: []
    -
    -Explanation: The endWord "cog" is not in wordList, therefore no possible transformation.
    +Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
    +Output: []
    +Explanation: The endWord "cog" is not in wordList, therefore no possible transformation.
     
    +

     

    +

    Constraints:

    +
      +
    • 1 <= beginWord.length <= 10
    • +
    • 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 6d10e1a70..af0abba75 100644 --- a/readme/1-300.md +++ b/readme/1-300.md @@ -107,7 +107,7 @@ LeetCode Problems' Solutions | 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position "搜索插入位置") | [Go](../problems/search-insert-position) | Easy | | 36 | [Valid Sudoku](https://leetcode.com/problems/valid-sudoku "有效的数独") | [Go](../problems/valid-sudoku) | Medium | | 37 | [Sudoku Solver](https://leetcode.com/problems/sudoku-solver "解数独") | [Go](../problems/sudoku-solver) | Hard | -| 38 | [Count and Say](https://leetcode.com/problems/count-and-say "外观数列") | [Go](../problems/count-and-say) | Easy | +| 38 | [Count and Say](https://leetcode.com/problems/count-and-say "外观数列") | [Go](../problems/count-and-say) | Medium | | 39 | [Combination Sum](https://leetcode.com/problems/combination-sum "组合总和") | [Go](../problems/combination-sum) | Medium | | 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii "组合总和 II") | [Go](../problems/combination-sum-ii) | Medium | | 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive "缺失的第一个正数") | [Go](../problems/first-missing-positive) | Hard | @@ -162,7 +162,7 @@ LeetCode Problems' Solutions | 90 | [Subsets II](https://leetcode.com/problems/subsets-ii "子集 II") | [Go](../problems/subsets-ii) | Medium | | 91 | [Decode Ways](https://leetcode.com/problems/decode-ways "解码方法") | [Go](../problems/decode-ways) | Medium | | 92 | [Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii "反转链表 II") | [Go](../problems/reverse-linked-list-ii) | Medium | -| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses "复原IP地址") | [Go](../problems/restore-ip-addresses) | Medium | +| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses "复原 IP 地址") | [Go](../problems/restore-ip-addresses) | Medium | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal "二叉树的中序遍历") | [Go](../problems/binary-tree-inorder-traversal) | Medium | | 95 | [Unique Binary Search Trees II](https://leetcode.com/problems/unique-binary-search-trees-ii "不同的二叉搜索树 II") | [Go](../problems/unique-binary-search-trees-ii) | Medium | | 96 | [Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees "不同的二叉搜索树") | [Go](../problems/unique-binary-search-trees) | Medium | @@ -176,7 +176,7 @@ LeetCode Problems' Solutions | 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) | Medium | | 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 | diff --git a/readme/301-600.md b/readme/301-600.md index 7e8d51d89..abdde95ce 100644 --- a/readme/301-600.md +++ b/readme/301-600.md @@ -117,7 +117,7 @@ LeetCode Problems' Solutions | 345 | [Reverse Vowels of a String](https://leetcode.com/problems/reverse-vowels-of-a-string "反转字符串中的元音字母") | [Go](../problems/reverse-vowels-of-a-string) | Easy | | 346 | [Moving Average from Data Stream](https://leetcode.com/problems/moving-average-from-data-stream "数据流中的移动平均值") 🔒 | [Go](../problems/moving-average-from-data-stream) | Easy | | 347 | [Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements "前 K 个高频元素") | [Go](../problems/top-k-frequent-elements) | Medium | -| 348 | [Design Tic-Tac-Toe](https://leetcode.com/problems/design-tic-tac-toe "判定井字棋胜负") 🔒 | [Go](../problems/design-tic-tac-toe) | Medium | +| 348 | [Design Tic-Tac-Toe](https://leetcode.com/problems/design-tic-tac-toe "设计井字棋") 🔒 | [Go](../problems/design-tic-tac-toe) | Medium | | 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays "两个数组的交集") | [Go](../problems/intersection-of-two-arrays) | Easy | | 350 | [Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii "两个数组的交集 II") | [Go](../problems/intersection-of-two-arrays-ii) | Easy | | 351 | [Android Unlock Patterns](https://leetcode.com/problems/android-unlock-patterns "安卓系统手势解锁") 🔒 | [Go](../problems/android-unlock-patterns) | Medium | @@ -147,7 +147,7 @@ LeetCode Problems' Solutions | 375 | [Guess Number Higher or Lower II](https://leetcode.com/problems/guess-number-higher-or-lower-ii "猜数字大小 II") | [Go](../problems/guess-number-higher-or-lower-ii) | Medium | | 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence "摆动序列") | [Go](../problems/wiggle-subsequence) | Medium | | 377 | [Combination Sum IV](https://leetcode.com/problems/combination-sum-iv "组合总和 Ⅳ") | [Go](../problems/combination-sum-iv) | Medium | -| 378 | [Kth Smallest Element in a Sorted Matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix "有序矩阵中第K小的元素") | [Go](../problems/kth-smallest-element-in-a-sorted-matrix) | Medium | +| 378 | [Kth Smallest Element in a Sorted Matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix "有序矩阵中第 K 小的元素") | [Go](../problems/kth-smallest-element-in-a-sorted-matrix) | Medium | | 379 | [Design Phone Directory](https://leetcode.com/problems/design-phone-directory "电话目录管理系统") 🔒 | [Go](../problems/design-phone-directory) | Medium | | 380 | [Insert Delete GetRandom O(1)](https://leetcode.com/problems/insert-delete-getrandom-o1 "常数时间插入、删除和获取随机元素") | [Go](../problems/insert-delete-getrandom-o1) | Medium | | 381 | [Insert Delete GetRandom O(1) - Duplicates allowed](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed "O(1) 时间插入、删除和获取随机元素 - 允许重复") | [Go](../problems/insert-delete-getrandom-o1-duplicates-allowed) | Hard | @@ -180,7 +180,7 @@ LeetCode Problems' Solutions | 408 | [Valid Word Abbreviation](https://leetcode.com/problems/valid-word-abbreviation "有效单词缩写") 🔒 | [Go](../problems/valid-word-abbreviation) | Easy | | 409 | [Longest Palindrome](https://leetcode.com/problems/longest-palindrome "最长回文串") | [Go](../problems/longest-palindrome) | Easy | | 410 | [Split Array Largest Sum](https://leetcode.com/problems/split-array-largest-sum "分割数组的最大值") | [Go](../problems/split-array-largest-sum) | Hard | -| 411 | [Minimum Unique Word Abbreviation](https://leetcode.com/problems/minimum-unique-word-abbreviation "最短特异单词缩写") 🔒 | [Go](../problems/minimum-unique-word-abbreviation) | Hard | +| 411 | [Minimum Unique Word Abbreviation](https://leetcode.com/problems/minimum-unique-word-abbreviation "最短独占单词缩写") 🔒 | [Go](../problems/minimum-unique-word-abbreviation) | Hard | | 412 | [Fizz Buzz](https://leetcode.com/problems/fizz-buzz "Fizz Buzz") | [Go](../problems/fizz-buzz) | Easy | | 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices "等差数列划分") | [Go](../problems/arithmetic-slices) | Medium | | 414 | [Third Maximum Number](https://leetcode.com/problems/third-maximum-number "第三大的数") | [Go](../problems/third-maximum-number) | Easy | @@ -254,7 +254,7 @@ LeetCode Problems' Solutions | 482 | [License Key Formatting](https://leetcode.com/problems/license-key-formatting "密钥格式化") | [Go](../problems/license-key-formatting) | Easy | | 483 | [Smallest Good Base](https://leetcode.com/problems/smallest-good-base "最小好进制") | [Go](../problems/smallest-good-base) | Hard | | 484 | [Find Permutation](https://leetcode.com/problems/find-permutation "寻找排列") 🔒 | [Go](../problems/find-permutation) | Medium | -| 485 | [Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones "最大连续1的个数") | [Go](../problems/max-consecutive-ones) | Easy | +| 485 | [Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones "最大连续 1 的个数") | [Go](../problems/max-consecutive-ones) | Easy | | 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner "预测赢家") | [Go](../problems/predict-the-winner) | Medium | | 487 | [Max Consecutive Ones II](https://leetcode.com/problems/max-consecutive-ones-ii "最大连续1的个数 II") 🔒 | [Go](../problems/max-consecutive-ones-ii) | Medium | | 488 | [Zuma Game](https://leetcode.com/problems/zuma-game "祖玛游戏") | [Go](../problems/zuma-game) | Hard | diff --git a/readme/601-900.md b/readme/601-900.md index 3030e2337..27be07057 100644 --- a/readme/601-900.md +++ b/readme/601-900.md @@ -108,7 +108,7 @@ LeetCode Problems' Solutions | 636 | [Exclusive Time of Functions](https://leetcode.com/problems/exclusive-time-of-functions "函数的独占时间") | [Go](../problems/exclusive-time-of-functions) | Medium | | 637 | [Average of Levels in Binary Tree](https://leetcode.com/problems/average-of-levels-in-binary-tree "二叉树的层平均值") | [Go](../problems/average-of-levels-in-binary-tree) | Easy | | 638 | [Shopping Offers](https://leetcode.com/problems/shopping-offers "大礼包") | [Go](../problems/shopping-offers) | Medium | -| 639 | [Decode Ways II](https://leetcode.com/problems/decode-ways-ii "解码方法 2") | [Go](../problems/decode-ways-ii) | Hard | +| 639 | [Decode Ways II](https://leetcode.com/problems/decode-ways-ii "解码方法 II") | [Go](../problems/decode-ways-ii) | Hard | | 640 | [Solve the Equation](https://leetcode.com/problems/solve-the-equation "求解方程") | [Go](../problems/solve-the-equation) | Medium | | 641 | [Design Circular Deque](https://leetcode.com/problems/design-circular-deque "设计循环双端队列") | [Go](../problems/design-circular-deque) | Medium | | 642 | [Design Search Autocomplete System](https://leetcode.com/problems/design-search-autocomplete-system "设计搜索自动补全系统") 🔒 | [Go](../problems/design-search-autocomplete-system) | Hard | @@ -135,7 +135,7 @@ LeetCode Problems' Solutions | 663 | [Equal Tree Partition](https://leetcode.com/problems/equal-tree-partition "均匀树划分") 🔒 | [Go](../problems/equal-tree-partition) | Medium | | 664 | [Strange Printer](https://leetcode.com/problems/strange-printer "奇怪的打印机") | [Go](../problems/strange-printer) | Hard | | 665 | [Non-decreasing Array](https://leetcode.com/problems/non-decreasing-array "非递减数列") | [Go](../problems/non-decreasing-array) | Medium | -| 666 | [Path Sum IV](https://leetcode.com/problems/path-sum-iv "路径和 IV") 🔒 | [Go](../problems/path-sum-iv) | Medium | +| 666 | [Path Sum IV](https://leetcode.com/problems/path-sum-iv "路径总和 IV") 🔒 | [Go](../problems/path-sum-iv) | Medium | | 667 | [Beautiful Arrangement II](https://leetcode.com/problems/beautiful-arrangement-ii "优美的排列 II") | [Go](../problems/beautiful-arrangement-ii) | Medium | | 668 | [Kth Smallest Number in Multiplication Table](https://leetcode.com/problems/kth-smallest-number-in-multiplication-table "乘法表中第k小的数") | [Go](../problems/kth-smallest-number-in-multiplication-table) | Hard | | 669 | [Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree "修剪二叉搜索树") | [Go](../problems/trim-a-binary-search-tree) | Medium | @@ -262,7 +262,7 @@ LeetCode Problems' Solutions | 790 | [Domino and Tromino Tiling](https://leetcode.com/problems/domino-and-tromino-tiling "多米诺和托米诺平铺") | [Go](../problems/domino-and-tromino-tiling) | Medium | | 791 | [Custom Sort String](https://leetcode.com/problems/custom-sort-string "自定义字符串排序") | [Go](../problems/custom-sort-string) | Medium | | 792 | [Number of Matching Subsequences](https://leetcode.com/problems/number-of-matching-subsequences "匹配子序列的单词数") | [Go](../problems/number-of-matching-subsequences) | Medium | -| 793 | [Preimage Size of Factorial Zeroes Function](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function "阶乘函数后K个零") | [Go](../problems/preimage-size-of-factorial-zeroes-function) | Hard | +| 793 | [Preimage Size of Factorial Zeroes Function](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function "阶乘函数后 K 个零") | [Go](../problems/preimage-size-of-factorial-zeroes-function) | Hard | | 794 | [Valid Tic-Tac-Toe State](https://leetcode.com/problems/valid-tic-tac-toe-state "有效的井字游戏") | [Go](../problems/valid-tic-tac-toe-state) | Medium | | 795 | [Number of Subarrays with Bounded Maximum](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum "区间子数组个数") | [Go](../problems/number-of-subarrays-with-bounded-maximum) | Medium | | 796 | [Rotate String](https://leetcode.com/problems/rotate-string "旋转字符串") | [Go](../problems/rotate-string) | Easy | diff --git a/tag/README.md b/tag/README.md index 1da49de17..d5c45a064 100644 --- a/tag/README.md +++ b/tag/README.md @@ -29,4 +29,5 @@ | 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 | [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/) | +| 41 | [](meet-in-the-middle/README.md) | [](https://openset.github.io/tags/meet-in-the-middle/) | | 42 | [Memoization](memoization/README.md) | [记忆化](https://openset.github.io/tags/memoization/) | +| 43 | [](oop/README.md) | [](https://openset.github.io/tags/oop/) | \ No newline at end of file diff --git a/tag/backtracking/README.md b/tag/backtracking/README.md index 94b8cca71..124b4c278 100644 --- a/tag/backtracking/README.md +++ b/tag/backtracking/README.md @@ -9,3 +9,69 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1723 | [完成所有工作的最短时间](../../problems/find-minimum-time-to-finish-all-jobs) | [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1718 | [构建字典序最大的可行序列](../../problems/construct-the-lexicographically-largest-valid-sequence) | [[递归](../recursion/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 1688 | [比赛中的配对次数](../../problems/count-of-matches-in-tournament) | [[回溯算法](../backtracking/README.md)] | Easy | +| 1681 | [最小不兼容性](../../problems/minimum-incompatibility) | [[贪心算法](../greedy/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 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 | +| 1641 | [统计字典序元音字符串的数目](../../problems/count-sorted-vowel-strings) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 1617 | [统计子树中城市之间最大距离](../../problems/count-subtrees-with-max-distance-between-cities) | [[回溯算法](../backtracking/README.md)] | Hard | +| 1593 | [拆分字符串使唯一子字符串的数目最大](../../problems/split-a-string-into-the-max-number-of-unique-substrings) | [[回溯算法](../backtracking/README.md)] | Medium | +| 1467 | [两个盒子中球的颜色数相同的概率](../../problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1415 | [长度为 n 的开心字符串中字典序第 k 小的字符串](../../problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n) | [[回溯算法](../backtracking/README.md)] | Medium | +| 1307 | [口算难题](../../problems/verbal-arithmetic-puzzle) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1291 | [顺次数](../../problems/sequential-digits) | [[回溯算法](../backtracking/README.md)] | Medium | +| 1286 | [字母组合迭代器](../../problems/iterator-for-combination) | [[设计](../design/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 1258 | [近义词句子](../../problems/synonymous-sentences) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 1240 | [铺瓷砖](../../problems/tiling-a-rectangle-with-the-fewest-squares) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1239 | [串联字符串的最大长度](../../problems/maximum-length-of-a-concatenated-string-with-unique-characters) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 1219 | [黄金矿工](../../problems/path-with-maximum-gold) | [[回溯算法](../backtracking/README.md)] | Medium | +| 1215 | [步进数](../../problems/stepping-numbers) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 1088 | [易混淆数 II](../../problems/confusing-number-ii) 🔒 | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1087 | [花括号展开](../../problems/brace-expansion) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 1079 | [活字印刷](../../problems/letter-tile-possibilities) | [[回溯算法](../backtracking/README.md)] | Medium | +| 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 | +| 691 | [贴纸拼词](../../problems/stickers-to-spell-word) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 526 | [优美的排列](../../problems/beautiful-arrangement) | [[深度优先搜索](../depth-first-search/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 425 | [单词方块](../../problems/word-squares) 🔒 | [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 411 | [最短独占单词缩写](../../problems/minimum-unique-word-abbreviation) 🔒 | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 401 | [二进制手表](../../problems/binary-watch) | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Easy | +| 357 | [计算各个位数不同的数字个数](../../problems/count-numbers-with-unique-digits) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 351 | [安卓系统手势解锁](../../problems/android-unlock-patterns) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 320 | [列举单词的全部缩写](../../problems/generalized-abbreviation) 🔒 | [[位运算](../bit-manipulation/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 306 | [累加数](../../problems/additive-number) | [[回溯算法](../backtracking/README.md)] | Medium | +| 294 | [翻转游戏 II](../../problems/flip-game-ii) 🔒 | [[极小化极大](../minimax/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 291 | [单词规律 II](../../problems/word-pattern-ii) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 267 | [回文排列 II](../../problems/palindrome-permutation-ii) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 254 | [因子的组合](../../problems/factor-combinations) 🔒 | [[回溯算法](../backtracking/README.md)] | Medium | +| 216 | [组合总和 III](../../problems/combination-sum-iii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 212 | [单词搜索 II](../../problems/word-search-ii) | [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 211 | [添加与搜索单词 - 数据结构设计](../../problems/design-add-and-search-words-data-structure) | [[深度优先搜索](../depth-first-search/README.md)] [[设计](../design/README.md)] [[字典树](../trie/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 140 | [单词拆分 II](../../problems/word-break-ii) | [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 131 | [分割回文串](../../problems/palindrome-partitioning) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 126 | [单词接龙 II](../../problems/word-ladder-ii) | [[广度优先搜索](../breadth-first-search/README.md)] [[数组](../array/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 93 | [复原 IP 地址](../../problems/restore-ip-addresses) | [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 90 | [子集 II](../../problems/subsets-ii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 89 | [格雷编码](../../problems/gray-code) | [[回溯算法](../backtracking/README.md)] | Medium | +| 79 | [单词搜索](../../problems/word-search) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 78 | [子集](../../problems/subsets) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 77 | [组合](../../problems/combinations) | [[回溯算法](../backtracking/README.md)] | Medium | +| 60 | [排列序列](../../problems/permutation-sequence) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 52 | [N皇后 II](../../problems/n-queens-ii) | [[回溯算法](../backtracking/README.md)] | Hard | +| 51 | [N 皇后](../../problems/n-queens) | [[回溯算法](../backtracking/README.md)] | Hard | +| 47 | [全排列 II](../../problems/permutations-ii) | [[回溯算法](../backtracking/README.md)] | Medium | +| 46 | [全排列](../../problems/permutations) | [[回溯算法](../backtracking/README.md)] | Medium | +| 44 | [通配符匹配](../../problems/wildcard-matching) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 40 | [组合总和 II](../../problems/combination-sum-ii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 39 | [组合总和](../../problems/combination-sum) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 37 | [解数独](../../problems/sudoku-solver) | [[哈希表](../hash-table/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 22 | [括号生成](../../problems/generate-parentheses) | [[字符串](../string/README.md)] [[回溯算法](../backtracking/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 | +| 10 | [正则表达式匹配](../../problems/regular-expression-matching) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | diff --git a/tag/binary-search/README.md b/tag/binary-search/README.md index 31963f6d8..66f158290 100644 --- a/tag/binary-search/README.md +++ b/tag/binary-search/README.md @@ -9,6 +9,8 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1760 | [袋子里最少数目的球](../../problems/minimum-limit-of-balls-in-a-bag) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1751 | [最多可以参加的会议数目 II](../../problems/maximum-number-of-events-that-can-be-attended-ii) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | | 1739 | [放置盒子](../../problems/building-boxes) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | | 1712 | [将数组分成三个子数组的方案数](../../problems/ways-to-split-array-into-three-subarrays) | [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1658 | [将 x 减到 0 的最小操作数](../../problems/minimum-operations-to-reduce-x-to-zero) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | @@ -51,7 +53,7 @@ | 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 | | 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 | +| 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 | | 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 | @@ -75,7 +77,7 @@ | 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 | -| 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 | | 363 | [矩形区域不超过 K 的最大数值和](../../problems/max-sum-of-rectangle-no-larger-than-k) | [[队列](../queue/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | diff --git a/tag/bit-manipulation/README.md b/tag/bit-manipulation/README.md index 864999c74..5e37da64c 100644 --- a/tag/bit-manipulation/README.md +++ b/tag/bit-manipulation/README.md @@ -44,7 +44,7 @@ | 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 | +| 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 | diff --git a/tag/breadth-first-search/README.md b/tag/breadth-first-search/README.md index e88d1c101..f68972b31 100644 --- a/tag/breadth-first-search/README.md +++ b/tag/breadth-first-search/README.md @@ -9,6 +9,8 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1766 | [互质树](../../problems/tree-of-coprimes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] | Hard | +| 1765 | [地图中的最高点](../../problems/map-of-highest-peak) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | | 1740 | [找到二叉树中的距离](../../problems/find-distance-in-a-binary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | | 1730 | [获取食物的最短路径](../../problems/shortest-path-to-get-food) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | | 1654 | [到家的最少跳跃次数](../../problems/minimum-jumps-to-reach-home) | [[广度优先搜索](../breadth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | @@ -82,14 +84,14 @@ | 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 | | 200 | [岛屿数量](../../problems/number-of-islands) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | -| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[队列](../queue/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)] | 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 | +| 107 | [二叉树的层序遍历 II](../../problems/binary-tree-level-order-traversal-ii) | [[树](../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 | diff --git a/tag/depth-first-search/README.md b/tag/depth-first-search/README.md index fd6aef291..92f2a97c3 100644 --- a/tag/depth-first-search/README.md +++ b/tag/depth-first-search/README.md @@ -9,3 +9,158 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1766 | [互质树](../../problems/tree-of-coprimes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] | Hard | +| 1740 | [找到二叉树中的距离](../../problems/find-distance-in-a-binary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1730 | [获取食物的最短路径](../../problems/shortest-path-to-get-food) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 1722 | [执行交换操作后的最小汉明距离](../../problems/minimize-hamming-distance-after-swap-operations) | [[贪心算法](../greedy/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 1676 | [二叉树的最近公共祖先 IV](../../problems/lowest-common-ancestor-of-a-binary-tree-iv) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1666 | [改变二叉树的根节点](../../problems/change-the-root-of-a-binary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1631 | [最小体力消耗路径](../../problems/path-with-minimum-effort) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1625 | [执行操作后字典序最小的字符串](../../problems/lexicographically-smallest-string-after-applying-operations) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1559 | [二维网格图中探测环](../../problems/detect-cycles-in-2d-grid) | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 1530 | [好叶子节点对的数量](../../problems/number-of-good-leaf-nodes-pairs) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1519 | [子树中标签相同的节点数](../../problems/number-of-nodes-in-the-sub-tree-with-the-same-label) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1490 | [克隆 N 叉树](../../problems/clone-n-ary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1489 | [找到最小生成树里的关键边和伪关键边](../../problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Hard | +| 1485 | [克隆含随机指针的二叉树](../../problems/clone-binary-tree-with-random-pointer) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1469 | [寻找所有的独生节点](../../problems/find-all-the-lonely-nodes) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy | +| 1466 | [重新规划路线](../../problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/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 | +| 1448 | [统计二叉树中好节点的数目](../../problems/count-good-nodes-in-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1443 | [收集树上所有苹果的最少时间](../../problems/minimum-time-to-collect-all-apples-in-a-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1391 | [检查网格中是否存在有效路径](../../problems/check-if-there-is-a-valid-path-in-a-grid) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1379 | [找出克隆二叉树中的相同节点](../../problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] | Medium | +| 1377 | [T 秒后青蛙的位置](../../problems/frog-position-after-t-seconds) | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 1376 | [通知所有员工所需的时间](../../problems/time-needed-to-inform-all-employees) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1319 | [连通网络的操作次数](../../problems/number-of-operations-to-make-network-connected) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 1315 | [祖父节点值为偶数的节点和](../../problems/sum-of-nodes-with-even-valued-grandparent) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1306 | [跳跃游戏 III](../../problems/jump-game-iii) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] | Medium | +| 1302 | [层数最深叶子节点的和](../../problems/deepest-leaves-sum) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1273 | [删除树节点](../../problems/delete-tree-nodes) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1254 | [统计封闭岛屿的数目](../../problems/number-of-closed-islands) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1245 | [树的直径](../../problems/tree-diameter) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1242 | [多线程网页爬虫](../../problems/web-crawler-multithreaded) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1236 | [网络爬虫](../../problems/web-crawler) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 1203 | [项目管理](../../problems/sort-items-by-groups-respecting-dependencies) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[拓扑排序](../topological-sort/README.md)] | Hard | +| 1192 | [查找集群内的「关键连接」](../../problems/critical-connections-in-a-network) | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 1145 | [二叉树着色游戏](../../problems/binary-tree-coloring-game) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1136 | [平行课程](../../problems/parallel-courses) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1123 | [最深叶节点的最近公共祖先](../../problems/lowest-common-ancestor-of-deepest-leaves) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1110 | [删点成林](../../problems/delete-nodes-and-return-forest) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1102 | [得分最高的路径](../../problems/path-with-maximum-minimum-value) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium | +| 1080 | [根到叶路径上的不足节点](../../problems/insufficient-nodes-in-root-to-leaf-paths) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1061 | [按字典序排列最小的等效字符串](../../problems/lexicographically-smallest-equivalent-string) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 1059 | [从始点到终点的所有路径](../../problems/all-paths-from-source-lead-to-destination) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 1038 | [把二叉搜索树转换为累加树](../../problems/binary-search-tree-to-greater-sum-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[二叉搜索树](../binary-search-tree/README.md)] [[递归](../recursion/README.md)] | Medium | +| 1034 | [边框着色](../../problems/coloring-a-border) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1028 | [从先序遍历还原二叉树](../../problems/recover-a-tree-from-preorder-traversal) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 1026 | [节点与其祖先之间的最大差值](../../problems/maximum-difference-between-node-and-ancestor) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 1020 | [飞地的数量](../../problems/number-of-enclaves) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 988 | [从叶结点开始的最小字符串](../../problems/smallest-string-starting-from-leaf) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 987 | [二叉树的垂序遍历](../../problems/vertical-order-traversal-of-a-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 980 | [不同路径 III](../../problems/unique-paths-iii) | [[深度优先搜索](../depth-first-search/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 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)] [[递归](../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 | +| 934 | [最短的桥](../../problems/shortest-bridge) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/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 | +| 897 | [递增顺序查找树](../../problems/increasing-order-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy | +| 886 | [可能的二分法](../../problems/possible-bipartition) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 872 | [叶子相似的树](../../problems/leaf-similar-trees) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy | +| 865 | [具有所有最深节点的最小子树](../../problems/smallest-subtree-with-all-the-deepest-nodes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] | Medium | +| 863 | [二叉树中所有距离为 K 的结点](../../problems/all-nodes-distance-k-in-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 851 | [喧闹和富有](../../problems/loud-and-rich) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 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 | +| 834 | [树中距离之和](../../problems/sum-of-distances-in-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 827 | [最大人工岛](../../problems/making-a-large-island) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/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 | +| 783 | [二叉搜索树节点最小距离](../../problems/minimum-distance-between-bst-nodes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy | +| 778 | [水位上升的泳池中游泳](../../problems/swim-in-rising-water) | [[堆](../heap/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 756 | [金字塔转换矩阵](../../problems/pyramid-transition-matrix) | [[位运算](../bit-manipulation/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 753 | [破解保险箱](../../problems/cracking-the-safe) | [[深度优先搜索](../depth-first-search/README.md)] [[数学](../math/README.md)] | Hard | +| 749 | [隔离病毒](../../problems/contain-virus) | [[深度优先搜索](../depth-first-search/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 | +| 737 | [句子相似性 II](../../problems/sentence-similarity-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 733 | [图像渲染](../../problems/flood-fill) | [[深度优先搜索](../depth-first-search/README.md)] | Easy | +| 721 | [账户合并](../../problems/accounts-merge) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 711 | [不同岛屿的数量 II](../../problems/number-of-distinct-islands-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 695 | [岛屿的最大面积](../../problems/max-area-of-island) | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 694 | [不同岛屿的数量](../../problems/number-of-distinct-islands) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 690 | [员工的重要性](../../problems/employee-importance) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 685 | [冗余连接 II](../../problems/redundant-connection-ii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Hard | +| 679 | [24 点游戏](../../problems/24-game) | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 664 | [奇怪的打印机](../../problems/strange-printer) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 638 | [大礼包](../../problems/shopping-offers) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 576 | [出界的路径数](../../problems/out-of-boundary-paths) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 563 | [二叉树的坡度](../../problems/binary-tree-tilt) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/README.md)] | Easy | +| 559 | [N 叉树的最大深度](../../problems/maximum-depth-of-n-ary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy | +| 547 | [省份数量](../../problems/number-of-provinces) | [[深度优先搜索](../depth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 546 | [移除盒子](../../problems/remove-boxes) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 542 | [01 矩阵](../../problems/01-matrix) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 538 | [把二叉搜索树转换为累加树](../../problems/convert-bst-to-greater-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[二叉搜索树](../binary-search-tree/README.md)] [[递归](../recursion/README.md)] | Medium | +| 533 | [孤独像素 II](../../problems/lonely-pixel-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 531 | [孤独像素 I](../../problems/lonely-pixel-i) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 529 | [扫雷游戏](../../problems/minesweeper) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 526 | [优美的排列](../../problems/beautiful-arrangement) | [[深度优先搜索](../depth-first-search/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 515 | [在每个树行中找最大值](../../problems/find-largest-value-in-each-tree-row) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 514 | [自由之路](../../problems/freedom-trail) | [[深度优先搜索](../depth-first-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 513 | [找树左下角的值](../../problems/find-bottom-left-tree-value) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 505 | [迷宫 II](../../problems/the-maze-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 499 | [迷宫 III](../../problems/the-maze-iii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Hard | +| 494 | [目标和](../../problems/target-sum) | [[深度优先搜索](../depth-first-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 491 | [递增子序列](../../problems/increasing-subsequences) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 490 | [迷宫](../../problems/the-maze) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 489 | [扫地机器人](../../problems/robot-room-cleaner) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 488 | [祖玛游戏](../../problems/zuma-game) | [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 473 | [火柴拼正方形](../../problems/matchsticks-to-square) | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 472 | [连接词](../../problems/concatenated-words) | [[深度优先搜索](../depth-first-search/README.md)] [[字典树](../trie/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 439 | [三元表达式解析器](../../problems/ternary-expression-parser) 🔒 | [[栈](../stack/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 430 | [扁平化多级双向链表](../../problems/flatten-a-multilevel-doubly-linked-list) | [[深度优先搜索](../depth-first-search/README.md)] [[链表](../linked-list/README.md)] | Medium | +| 417 | [太平洋大西洋水流问题](../../problems/pacific-atlantic-water-flow) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 394 | [字符串解码](../../problems/decode-string) | [[栈](../stack/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 366 | [寻找二叉树的叶子节点](../../problems/find-leaves-of-binary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 364 | [加权嵌套序列和 II](../../problems/nested-list-weight-sum-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 339 | [嵌套列表权重和](../../problems/nested-list-weight-sum) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Easy | +| 337 | [打家劫舍 III](../../problems/house-robber-iii) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | +| 332 | [重新安排行程](../../problems/reconstruct-itinerary) | [[深度优先搜索](../depth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 329 | [矩阵中的最长递增路径](../../problems/longest-increasing-path-in-a-matrix) | [[深度优先搜索](../depth-first-search/README.md)] [[拓扑排序](../topological-sort/README.md)] [[记忆化](../memoization/README.md)] | Hard | +| 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 | +| 314 | [二叉树的垂直遍历](../../problems/binary-tree-vertical-order-traversal) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 301 | [删除无效的括号](../../problems/remove-invalid-parentheses) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/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 | +| 257 | [二叉树的所有路径](../../problems/binary-tree-paths) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Easy | +| 211 | [添加与搜索单词 - 数据结构设计](../../problems/design-add-and-search-words-data-structure) | [[深度优先搜索](../depth-first-search/README.md)] [[设计](../design/README.md)] [[字典树](../trie/README.md)] [[回溯算法](../backtracking/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 | +| 200 | [岛屿数量](../../problems/number-of-islands) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[并查集](../union-find/README.md)] | Medium | +| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[队列](../queue/README.md)] | Medium | +| 133 | [克隆图](../../problems/clone-graph) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 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)] [[递归](../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)] [[递归](../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 | +| 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 | +| 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 | +| 99 | [恢复二叉搜索树](../../problems/recover-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Hard | +| 98 | [验证二叉搜索树](../../problems/validate-binary-search-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[递归](../recursion/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/design/README.md b/tag/design/README.md index 1bbe3ca62..f50d33a44 100644 --- a/tag/design/README.md +++ b/tag/design/README.md @@ -9,6 +9,7 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1756 | [Design Most Recently Used Queue](../../problems/design-most-recently-used-queue) 🔒 | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | | 1670 | [设计前中后队列](../../problems/design-front-middle-back-queue) | [[设计](../design/README.md)] [[链表](../linked-list/README.md)] | Medium | | 1656 | [设计有序流](../../problems/design-an-ordered-stream) | [[设计](../design/README.md)] [[数组](../array/README.md)] | Easy | | 1628 | [设计带解析函数的表达式树](../../problems/design-an-expression-tree-with-evaluate-function) 🔒 | [[树](../tree/README.md)] [[设计](../design/README.md)] | Medium | @@ -50,7 +51,7 @@ | 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 | | 353 | [贪吃蛇](../../problems/design-snake-game) 🔒 | [[设计](../design/README.md)] [[队列](../queue/README.md)] | Medium | -| 348 | [判定井字棋胜负](../../problems/design-tic-tac-toe) 🔒 | [[设计](../design/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 | | 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 | diff --git a/tag/divide-and-conquer/README.md b/tag/divide-and-conquer/README.md index 9fcc476e7..22827330d 100644 --- a/tag/divide-and-conquer/README.md +++ b/tag/divide-and-conquer/README.md @@ -9,6 +9,7 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1755 | [最接近目标值的子序列和](../../problems/closest-subsequence-sum) | [[分治算法](../divide-and-conquer/README.md)] | Hard | | 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 | diff --git a/tag/dynamic-programming/README.md b/tag/dynamic-programming/README.md index 11f2f43fb..882b2c7e5 100644 --- a/tag/dynamic-programming/README.md +++ b/tag/dynamic-programming/README.md @@ -9,248 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 1746 | [Maximum Subarray Sum After One Operation](../../problems/maximum-subarray-sum-after-one-operation) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium | -| 1745 | [回文串分割 IV](../../problems/palindrome-partitioning-iv) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | -| 1728 | [猫和老鼠 II](../../problems/cat-and-mouse-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard | -| 1724 | [检查边长度限制的路径是否存在 II](../../problems/checking-existence-of-edge-length-limited-paths-ii) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | -| 1706 | [球会落何处](../../problems/where-will-the-ball-fall) | [[动态规划](../dynamic-programming/README.md)] | Medium | -| 1692 | [计算分配糖果的不同方式](../../problems/count-ways-to-distribute-candies) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard | -| 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 | [最长回文子序列 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) | [[哈希表](../hash-table/README.md)] [[数学](../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)] | Medium | -| 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 | -| 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/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 | 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..3abb38b20 100644 --- a/tag/graph/README.md +++ b/tag/graph/README.md @@ -9,3 +9,56 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1765 | [地图中的最高点](../../problems/map-of-highest-peak) | [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 1761 | [一个图中连通三元组的最小度数](../../problems/minimum-degree-of-a-connected-trio-in-a-graph) | [[图](../graph/README.md)] | Hard | +| 1730 | [获取食物的最短路径](../../problems/shortest-path-to-get-food) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[图](../graph/README.md)] | Medium | +| 1724 | [检查边长度限制的路径是否存在 II](../../problems/checking-existence-of-edge-length-limited-paths-ii) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1719 | [重构一棵树的方案数](../../problems/number-of-ways-to-reconstruct-a-tree) | [[树](../tree/README.md)] [[图](../graph/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 | +| 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 f55fc7e68..529ffe482 100644 --- a/tag/greedy/README.md +++ b/tag/greedy/README.md @@ -9,6 +9,13 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1769 | [移动所有球到每个盒子所需的最小操作数](../../problems/minimum-number-of-operations-to-move-all-balls-to-each-box) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1764 | [通过连接另一个数组的子数组得到一个数组](../../problems/form-array-by-concatenating-subarrays-of-another-array) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1762 | [Buildings With an Ocean View](../../problems/buildings-with-an-ocean-view) 🔒 | [[贪心算法](../greedy/README.md)] | Medium | +| 1759 | [统计同构子字符串的数目](../../problems/count-number-of-homogenous-substrings) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium | +| 1758 | [生成交替二进制字符串的最少操作数](../../problems/minimum-changes-to-make-alternating-binary-string) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Easy | +| 1754 | [构造字典序最大的合并字符串](../../problems/largest-merge-of-two-strings) | [[贪心算法](../greedy/README.md)] | Medium | +| 1749 | [任意子数组和的绝对值的最大值](../../problems/maximum-absolute-sum-of-any-subarray) | [[贪心算法](../greedy/README.md)] | Medium | | 1743 | [从相邻元素对还原数组](../../problems/restore-the-array-from-adjacent-pairs) | [[贪心算法](../greedy/README.md)] | Medium | | 1737 | [满足三条件之一需改变的最少字符数](../../problems/change-minimum-characters-to-satisfy-one-of-three-conditions) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium | | 1736 | [替换隐藏数字得到的最晚时间](../../problems/latest-time-by-replacing-hidden-digits) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Easy | diff --git a/tag/hash-table/README.md b/tag/hash-table/README.md index 1adf15714..f78d7bc25 100644 --- a/tag/hash-table/README.md +++ b/tag/hash-table/README.md @@ -9,3 +9,143 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1748 | [唯一元素的和](../../problems/sum-of-unique-elements) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1726 | [同积元组](../../problems/tuple-with-same-product) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1711 | [大餐计数](../../problems/count-good-meals) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 1679 | [K 和数对的最大数目](../../problems/max-number-of-k-sum-pairs) | [[哈希表](../hash-table/README.md)] | Medium | +| 1640 | [能否连接形成数组](../../problems/check-array-formation-through-concatenation) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1638 | [统计只差一个字符的子串数目](../../problems/count-substrings-that-differ-by-one-character) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 1612 | [检查两棵二叉表达式树是否等价](../../problems/check-if-two-expression-trees-are-equivalent) 🔒 | [[树](../tree/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1590 | [使数组和能被 P 整除](../../problems/make-sum-divisible-by-p) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1577 | [数的平方等于两数乘积的方法数](../../problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 1570 | [两个稀疏向量的点积](../../problems/dot-product-of-two-sparse-vectors) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 1539 | [第 k 个缺失的正整数](../../problems/kth-missing-positive-number) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1512 | [好数对的数目](../../problems/number-of-good-pairs) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 1490 | [克隆 N 叉树](../../problems/clone-n-ary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1488 | [避免洪水泛滥](../../problems/avoid-flood-in-the-city) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1487 | [保证文件名唯一](../../problems/making-file-names-unique) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 1429 | [第一个唯一数字](../../problems/first-unique-number) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1418 | [点菜展示表](../../problems/display-table-of-food-orders-in-a-restaurant) | [[哈希表](../hash-table/README.md)] | Medium | +| 1365 | [有多少小于当前数字的数字](../../problems/how-many-numbers-are-smaller-than-the-current-number) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1311 | [获取你好友已观看的视频](../../problems/get-watched-videos-by-your-friends) | [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 1261 | [在受污染的二叉树中查找元素](../../problems/find-elements-in-a-contaminated-binary-tree) | [[树](../tree/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1244 | [力扣排行榜](../../problems/design-a-leaderboard) 🔒 | [[排序](../sort/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1224 | [最大相等频率](../../problems/maximum-equal-frequency) | [[哈希表](../hash-table/README.md)] | Hard | +| 1218 | [最长定差子序列](../../problems/longest-arithmetic-subsequence-of-given-difference) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1213 | [三个有序数组的交集](../../problems/intersection-of-three-sorted-arrays) 🔒 | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Easy | +| 1207 | [独一无二的出现次数](../../problems/unique-number-of-occurrences) | [[哈希表](../hash-table/README.md)] | Easy | +| 1198 | [找出所有行中最小公共元素](../../problems/find-smallest-common-element-in-all-rows) 🔒 | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1189 | [“气球” 的最大数量](../../problems/maximum-number-of-balloons) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Easy | +| 1178 | [猜字谜](../../problems/number-of-valid-words-for-each-puzzle) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 1166 | [设计文件系统](../../problems/design-file-system) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1160 | [拼写单词](../../problems/find-words-that-can-be-formed-by-characters) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1152 | [用户网站访问行为分析](../../problems/analyze-user-website-visit-pattern) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1138 | [字母板上的路径](../../problems/alphabet-board-path) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 1133 | [最大唯一数](../../problems/largest-unique-number) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1090 | [受标签影响的最大值](../../problems/largest-values-from-labels) | [[贪心算法](../greedy/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1086 | [前五科的均分](../../problems/high-five) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1078 | [Bigram 分词](../../problems/occurrences-after-bigram) | [[哈希表](../hash-table/README.md)] | Easy | +| 1072 | [按列翻转得到最大值等行数](../../problems/flip-columns-for-maximum-number-of-equal-rows) | [[哈希表](../hash-table/README.md)] | Medium | +| 1048 | [最长字符串链](../../problems/longest-string-chain) | [[哈希表](../hash-table/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1044 | [最长重复子串](../../problems/longest-duplicate-substring) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 1002 | [查找常用字符](../../problems/find-common-characters) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1001 | [网格照明](../../problems/grid-illumination) | [[哈希表](../hash-table/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 | +| 987 | [二叉树的垂序遍历](../../problems/vertical-order-traversal-of-a-binary-tree) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 981 | [基于时间的键值存储](../../problems/time-based-key-value-store) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 974 | [和可被 K 整除的子数组](../../problems/subarray-sums-divisible-by-k) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 970 | [强整数](../../problems/powerful-integers) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 966 | [元音拼写检查器](../../problems/vowel-spellchecker) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 961 | [重复 N 次的元素](../../problems/n-repeated-element-in-size-2n-array) | [[哈希表](../hash-table/README.md)] | Easy | +| 957 | [N 天后的牢房](../../problems/prison-cells-after-n-days) | [[哈希表](../hash-table/README.md)] | Medium | +| 954 | [二倍数对数组](../../problems/array-of-doubled-pairs) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 953 | [验证外星语词典](../../problems/verifying-an-alien-dictionary) | [[哈希表](../hash-table/README.md)] | Easy | +| 939 | [最小面积矩形](../../problems/minimum-area-rectangle) | [[哈希表](../hash-table/README.md)] | Medium | +| 930 | [和相同的二元子数组](../../problems/binary-subarrays-with-sum) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 895 | [最大频率栈](../../problems/maximum-frequency-stack) | [[栈](../stack/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 884 | [两句话中的不常见单词](../../problems/uncommon-words-from-two-sentences) | [[哈希表](../hash-table/README.md)] | Easy | +| 811 | [子域名访问计数](../../problems/subdomain-visit-count) | [[哈希表](../hash-table/README.md)] | Easy | +| 781 | [森林中的兔子](../../problems/rabbits-in-forest) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 771 | [宝石与石头](../../problems/jewels-and-stones) | [[哈希表](../hash-table/README.md)] | Easy | +| 770 | [基本计算器 IV](../../problems/basic-calculator-iv) | [[栈](../stack/README.md)] [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Hard | +| 760 | [找出变位映射](../../problems/find-anagram-mappings) 🔒 | [[哈希表](../hash-table/README.md)] | Easy | +| 748 | [最短补全词](../../problems/shortest-completing-word) | [[哈希表](../hash-table/README.md)] | Easy | +| 739 | [每日温度](../../problems/daily-temperatures) | [[栈](../stack/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 734 | [句子相似性](../../problems/sentence-similarity) 🔒 | [[哈希表](../hash-table/README.md)] | Easy | +| 726 | [原子的数量](../../problems/number-of-atoms) | [[栈](../stack/README.md)] [[递归](../recursion/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 720 | [词典中最长的单词](../../problems/longest-word-in-dictionary) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 718 | [最长重复子数组](../../problems/maximum-length-of-repeated-subarray) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 711 | [不同岛屿的数量 II](../../problems/number-of-distinct-islands-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[哈希表](../hash-table/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 | +| 706 | [设计哈希映射](../../problems/design-hashmap) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 705 | [设计哈希集合](../../problems/design-hashset) | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 694 | [不同岛屿的数量](../../problems/number-of-distinct-islands) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 692 | [前K个高频单词](../../problems/top-k-frequent-words) | [[堆](../heap/README.md)] [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 690 | [员工的重要性](../../problems/employee-importance) | [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 676 | [实现一个魔法字典](../../problems/implement-magic-dictionary) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 648 | [单词替换](../../problems/replace-words) | [[字典树](../trie/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 645 | [错误的集合](../../problems/set-mismatch) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 632 | [最小区间](../../problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard | +| 624 | [数组列表中的最大距离](../../problems/maximum-distance-in-arrays) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 609 | [在系统中查找重复文件](../../problems/find-duplicate-file-in-system) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 599 | [两个列表的最小索引总和](../../problems/minimum-index-sum-of-two-lists) | [[哈希表](../hash-table/README.md)] | Easy | +| 594 | [最长和谐子序列](../../problems/longest-harmonious-subsequence) | [[哈希表](../hash-table/README.md)] | Easy | +| 575 | [分糖果](../../problems/distribute-candies) | [[哈希表](../hash-table/README.md)] | Easy | +| 560 | [和为K的子数组](../../problems/subarray-sum-equals-k) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 554 | [砖墙](../../problems/brick-wall) | [[哈希表](../hash-table/README.md)] | Medium | +| 535 | [TinyURL 的加密与解密](../../problems/encode-and-decode-tinyurl) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 525 | [连续数组](../../problems/contiguous-array) | [[哈希表](../hash-table/README.md)] | Medium | +| 508 | [出现次数最多的子树元素和](../../problems/most-frequent-subtree-sum) | [[树](../tree/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 500 | [键盘行](../../problems/keyboard-row) | [[哈希表](../hash-table/README.md)] | Easy | +| 463 | [岛屿的周长](../../problems/island-perimeter) | [[哈希表](../hash-table/README.md)] | Easy | +| 454 | [四数相加 II](../../problems/4sum-ii) | [[哈希表](../hash-table/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 451 | [根据字符出现频率排序](../../problems/sort-characters-by-frequency) | [[堆](../heap/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 447 | [回旋镖的数量](../../problems/number-of-boomerangs) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 438 | [找到字符串中所有字母异位词](../../problems/find-all-anagrams-in-a-string) | [[哈希表](../hash-table/README.md)] | Medium | +| 409 | [最长回文串](../../problems/longest-palindrome) | [[哈希表](../hash-table/README.md)] | Easy | +| 389 | [找不同](../../problems/find-the-difference) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 387 | [字符串中的第一个唯一字符](../../problems/first-unique-character-in-a-string) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Easy | +| 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 | +| 359 | [日志速率限制器](../../problems/logger-rate-limiter) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 358 | [K 距离间隔重排字符串](../../problems/rearrange-string-k-distance-apart) 🔒 | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[哈希表](../hash-table/README.md)] | Hard | +| 356 | [直线镜像](../../problems/line-reflection) 🔒 | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 355 | [设计推特](../../problems/design-twitter) | [[堆](../heap/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/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 | +| 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)] [[双指针](../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 | +| 299 | [猜数字游戏](../../problems/bulls-and-cows) | [[哈希表](../hash-table/README.md)] | Medium | +| 290 | [单词规律](../../problems/word-pattern) | [[哈希表](../hash-table/README.md)] | Easy | +| 288 | [单词的唯一缩写](../../problems/unique-word-abbreviation) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 274 | [H 指数](../../problems/h-index) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 266 | [回文排列](../../problems/palindrome-permutation) 🔒 | [[哈希表](../hash-table/README.md)] | Easy | +| 249 | [移位字符串分组](../../problems/group-shifted-strings) 🔒 | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 246 | [中心对称数](../../problems/strobogrammatic-number) 🔒 | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 244 | [最短单词距离 II](../../problems/shortest-word-distance-ii) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 242 | [有效的字母异位词](../../problems/valid-anagram) | [[排序](../sort/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 219 | [存在重复元素 II](../../problems/contains-duplicate-ii) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 217 | [存在重复元素](../../problems/contains-duplicate) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 205 | [同构字符串](../../problems/isomorphic-strings) | [[哈希表](../hash-table/README.md)] | Easy | +| 204 | [计数质数](../../problems/count-primes) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 202 | [快乐数](../../problems/happy-number) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 187 | [重复的DNA序列](../../problems/repeated-dna-sequences) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 170 | [两数之和 III - 数据结构设计](../../problems/two-sum-iii-data-structure-design) 🔒 | [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 166 | [分数到小数](../../problems/fraction-to-recurring-decimal) | [[哈希表](../hash-table/README.md)] [[数学](../math/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 | +| 149 | [直线上最多的点数](../../problems/max-points-on-a-line) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Hard | +| 138 | [复制带随机指针的链表](../../problems/copy-list-with-random-pointer) | [[哈希表](../hash-table/README.md)] [[链表](../linked-list/README.md)] | Medium | +| 136 | [只出现一次的数字](../../problems/single-number) | [[位运算](../bit-manipulation/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 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 | +| 76 | [最小覆盖子串](../../problems/minimum-window-substring) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 49 | [字母异位词分组](../../problems/group-anagrams) | [[哈希表](../hash-table/README.md)] [[字符串](../string/README.md)] | Medium | +| 37 | [解数独](../../problems/sudoku-solver) | [[哈希表](../hash-table/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 36 | [有效的数独](../../problems/valid-sudoku) | [[哈希表](../hash-table/README.md)] | Medium | +| 30 | [串联所有单词的子串](../../problems/substring-with-concatenation-of-all-words) | [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] [[字符串](../string/README.md)] | Hard | +| 18 | [四数之和](../../problems/4sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/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 | +| 1 | [两数之和](../../problems/two-sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | diff --git a/tag/heap/README.md b/tag/heap/README.md index 4bf8bcc92..4a7028b71 100644 --- a/tag/heap/README.md +++ b/tag/heap/README.md @@ -9,6 +9,8 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1760 | [袋子里最少数目的球](../../problems/minimum-limit-of-balls-in-a-bag) | [[堆](../heap/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1753 | [移除石子的最大得分](../../problems/maximum-score-from-removing-stones) | [[堆](../heap/README.md)] [[数学](../math/README.md)] | Medium | | 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 | | 1673 | [找出最具竞争力的子序列](../../problems/find-the-most-competitive-subsequence) | [[栈](../stack/README.md)] [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[队列](../queue/README.md)] | Medium | @@ -35,7 +37,7 @@ | 502 | [IPO](../../problems/ipo) | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] | Hard | | 451 | [根据字符出现频率排序](../../problems/sort-characters-by-frequency) | [[堆](../heap/README.md)] [[哈希表](../hash-table/README.md)] | Medium | | 407 | [接雨水 II](../../problems/trapping-rain-water-ii) | [[堆](../heap/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Hard | -| 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 | | 373 | [查找和最小的K对数字](../../problems/find-k-pairs-with-smallest-sums) | [[堆](../heap/README.md)] | Medium | | 358 | [K 距离间隔重排字符串](../../problems/rearrange-string-k-distance-apart) 🔒 | [[堆](../heap/README.md)] [[贪心算法](../greedy/README.md)] [[哈希表](../hash-table/README.md)] | Hard | | 355 | [设计推特](../../problems/design-twitter) | [[堆](../heap/README.md)] [[设计](../design/README.md)] [[哈希表](../hash-table/README.md)] | Medium | diff --git a/tag/line-sweep/README.md b/tag/line-sweep/README.md index 932db1472..592ea3e0f 100644 --- a/tag/line-sweep/README.md +++ b/tag/line-sweep/README.md @@ -9,9 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 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) 🔒 | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] [[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 8103f6eff..8642b2274 100644 --- a/tag/linked-list/README.md +++ b/tag/linked-list/README.md @@ -9,46 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 1721 | [交换链表中的节点](../../problems/swapping-nodes-in-a-linked-list) | [[链表](../linked-list/README.md)] | Medium | -| 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) | [[递归](../recursion/README.md)] [[链表](../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) | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] [[数学](../math/README.md)] | Medium | diff --git a/tag/math/README.md b/tag/math/README.md index fb0072c87..556dd37eb 100644 --- a/tag/math/README.md +++ b/tag/math/README.md @@ -9,3 +9,203 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1766 | [互质树](../../problems/tree-of-coprimes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] | Hard | +| 1753 | [移除石子的最大得分](../../problems/maximum-score-from-removing-stones) | [[堆](../heap/README.md)] [[数学](../math/README.md)] | Medium | +| 1744 | [你能在你最喜欢的那天吃到你最喜欢的糖果吗?](../../problems/can-you-eat-your-favorite-candy-on-your-favorite-day) | [[数学](../math/README.md)] | Medium | +| 1739 | [放置盒子](../../problems/building-boxes) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 1735 | [生成乘积数组的方案数](../../problems/count-ways-to-make-array-with-product) | [[数学](../math/README.md)] | Hard | +| 1716 | [计算力扣银行的钱](../../problems/calculate-money-in-leetcode-bank) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Easy | +| 1685 | [有序数组中差绝对值之和](../../problems/sum-of-absolute-differences-in-a-sorted-array) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium | +| 1680 | [连接连续二进制数字](../../problems/concatenation-of-consecutive-binary-numbers) | [[数学](../math/README.md)] | Medium | +| 1648 | [销售价值减少的颜色球](../../problems/sell-diminishing-valued-colored-balls) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[数学](../math/README.md)] | Medium | +| 1641 | [统计字典序元音字符串的数目](../../problems/count-sorted-vowel-strings) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 1627 | [带阈值的图连通性](../../problems/graph-connectivity-with-threshold) | [[并查集](../union-find/README.md)] [[数学](../math/README.md)] | Hard | +| 1622 | [奇妙序列](../../problems/fancy-sequence) | [[设计](../design/README.md)] [[数学](../math/README.md)] | Hard | +| 1590 | [使数组和能被 P 整除](../../problems/make-sum-divisible-by-p) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1577 | [数的平方等于两数乘积的方法数](../../problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 1551 | [使数组中所有元素相等的最小操作数](../../problems/minimum-operations-to-make-array-equal) | [[数学](../math/README.md)] | Medium | +| 1524 | [和为奇数的子数组数目](../../problems/number-of-sub-arrays-with-odd-sum) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1523 | [在区间范围内统计奇数数目](../../problems/count-odd-numbers-in-an-interval-range) | [[数学](../math/README.md)] | Easy | +| 1513 | [仅含 1 的子串数](../../problems/number-of-substrings-with-only-1s) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 1512 | [好数对的数目](../../problems/number-of-good-pairs) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 1497 | [检查数组对是否可以被 k 整除](../../problems/check-if-array-pairs-are-divisible-by-k) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1492 | [n 的第 k 个因子](../../problems/the-kth-factor-of-n) | [[数学](../math/README.md)] | Medium | +| 1478 | [安排邮筒](../../problems/allocate-mailboxes) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1467 | [两个盒子中球的颜色数相同的概率](../../problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1447 | [最简分数](../../problems/simplified-fractions) | [[数学](../math/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 | +| 1427 | [字符串的左右移](../../problems/perform-string-shifts) 🔒 | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1390 | [四因数](../../problems/four-divisors) | [[数学](../math/README.md)] | Medium | +| 1363 | [形成三的最大倍数](../../problems/largest-multiple-of-three) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1362 | [最接近的因数](../../problems/closest-divisors) | [[数学](../math/README.md)] | Medium | +| 1359 | [有效的快递序列数目](../../problems/count-all-valid-pickup-and-delivery-options) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1344 | [时钟指针的夹角](../../problems/angle-between-hands-of-a-clock) | [[数学](../math/README.md)] | Medium | +| 1330 | [翻转子数组得到最大的数组值](../../problems/reverse-subarray-to-maximize-array-value) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 1323 | [6 和 9 组成的最大数字](../../problems/maximum-69-number) | [[数学](../math/README.md)] | Easy | +| 1317 | [将整数转换为两个无零整数的和](../../problems/convert-integer-to-the-sum-of-two-no-zero-integers) | [[数学](../math/README.md)] | Easy | +| 1307 | [口算难题](../../problems/verbal-arithmetic-puzzle) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1281 | [整数的各位积和之差](../../problems/subtract-the-product-and-sum-of-digits-of-an-integer) | [[数学](../math/README.md)] | Easy | +| 1276 | [不浪费原料的汉堡制作方案](../../problems/number-of-burgers-with-no-waste-of-ingredients) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium | +| 1272 | [删除区间](../../problems/remove-interval) 🔒 | [[数学](../math/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium | +| 1271 | [十六进制魔术数字](../../problems/hexspeak) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy | +| 1259 | [不相交的握手](../../problems/handshakes-that-dont-cross) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1256 | [加密数字](../../problems/encode-number) 🔒 | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium | +| 1253 | [重构 2 行二进制矩阵](../../problems/reconstruct-a-2-row-binary-matrix) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium | +| 1250 | [检查「好数组」](../../problems/check-if-it-is-a-good-array) | [[数学](../math/README.md)] | Hard | +| 1238 | [循环码排列](../../problems/circular-permutation-in-binary-representation) | [[数学](../math/README.md)] | Medium | +| 1237 | [找出给定方程的正整数解](../../problems/find-positive-integer-solution-for-a-given-equation) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1232 | [缀点成线](../../problems/check-if-it-is-a-straight-line) | [[几何](../geometry/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1230 | [抛掷硬币](../../problems/toss-strange-coins) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1228 | [等差数列中缺失的数字](../../problems/missing-number-in-arithmetic-progression) 🔒 | [[数学](../math/README.md)] | Easy | +| 1227 | [飞机座位分配概率](../../problems/airplane-seat-assignment-probability) | [[脑筋急转弯](../brainteaser/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1218 | [最长定差子序列](../../problems/longest-arithmetic-subsequence-of-given-difference) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1217 | [玩筹码](../../problems/minimum-cost-to-move-chips-to-the-same-position) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1201 | [丑数 III](../../problems/ugly-number-iii) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1199 | [建造街区的最短时间](../../problems/minimum-time-to-build-blocks) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1183 | [矩阵中 1 的最大数量](../../problems/maximum-number-of-ones) 🔒 | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Hard | +| 1180 | [统计只含单一字母的子串](../../problems/count-substrings-with-only-one-distinct-letter) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy | +| 1175 | [质数排列](../../problems/prime-arrangements) | [[数学](../math/README.md)] | Easy | +| 1154 | [一年中的第几天](../../problems/day-of-the-year) | [[数学](../math/README.md)] | Easy | +| 1134 | [阿姆斯特朗数](../../problems/armstrong-number) 🔒 | [[数学](../math/README.md)] | Easy | +| 1131 | [绝对值表达式的最大值](../../problems/maximum-of-absolute-value-expression) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium | +| 1121 | [将数组分成几个递增序列](../../problems/divide-array-into-increasing-sequences) 🔒 | [[数学](../math/README.md)] | Hard | +| 1109 | [航班预订统计](../../problems/corporate-flight-bookings) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1104 | [二叉树寻路](../../problems/path-in-zigzag-labelled-binary-tree) | [[树](../tree/README.md)] [[数学](../math/README.md)] | Medium | +| 1103 | [分糖果 II](../../problems/distribute-candies-to-people) | [[数学](../math/README.md)] | Easy | +| 1093 | [大样本统计](../../problems/statistics-from-a-large-sample) | [[数学](../math/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 1088 | [易混淆数 II](../../problems/confusing-number-ii) 🔒 | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 1073 | [负二进制数相加](../../problems/adding-two-negabinary-numbers) | [[数学](../math/README.md)] | Medium | +| 1067 | [范围内的数字计数](../../problems/digit-count-in-range) 🔒 | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1058 | [最小化舍入误差以满足目标](../../problems/minimize-rounding-error-to-meet-target) 🔒 | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1056 | [易混淆数](../../problems/confusing-number) 🔒 | [[数学](../math/README.md)] | Easy | +| 1041 | [困于环中的机器人](../../problems/robot-bounded-in-circle) | [[数学](../math/README.md)] | Medium | +| 1037 | [有效的回旋镖](../../problems/valid-boomerang) | [[数学](../math/README.md)] | Easy | +| 1025 | [除数博弈](../../problems/divisor-game) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy | +| 1017 | [负二进制转换](../../problems/convert-to-base-2) | [[数学](../math/README.md)] | Medium | +| 1015 | [可被 K 整除的最小整数](../../problems/smallest-integer-divisible-by-k) | [[数学](../math/README.md)] | Medium | +| 1012 | [至少有 1 位重复的数字](../../problems/numbers-with-repeated-digits) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1009 | [十进制整数的反码](../../problems/complement-of-base-10-integer) | [[数学](../math/README.md)] | Easy | +| 1006 | [笨阶乘](../../problems/clumsy-factorial) | [[数学](../math/README.md)] | Medium | +| 996 | [正方形数组的数目](../../problems/number-of-squareful-arrays) | [[图](../graph/README.md)] [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 991 | [坏了的计算器](../../problems/broken-calculator) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium | +| 976 | [三角形的最大周长](../../problems/largest-perimeter-triangle) | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Easy | +| 972 | [相等的有理数](../../problems/equal-rational-numbers) | [[数学](../math/README.md)] | Hard | +| 970 | [强整数](../../problems/powerful-integers) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 964 | [表示数字的最少运算符](../../problems/least-operators-to-express-number) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 963 | [最小面积矩形 II](../../problems/minimum-area-rectangle-ii) | [[几何](../geometry/README.md)] [[数学](../math/README.md)] | Medium | +| 952 | [按公因数计算最大组件大小](../../problems/largest-component-size-by-common-factor) | [[并查集](../union-find/README.md)] [[数学](../math/README.md)] | Hard | +| 949 | [给定数字能组成的最大时间](../../problems/largest-time-for-given-digits) | [[数学](../math/README.md)] | Medium | +| 942 | [增减字符串匹配](../../problems/di-string-match) | [[数学](../math/README.md)] | Easy | +| 927 | [三等分](../../problems/three-equal-parts) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 914 | [卡牌分组](../../problems/x-of-a-kind-in-a-deck-of-cards) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 910 | [最小差值 II](../../problems/smallest-range-ii) | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] | Medium | +| 908 | [最小差值 I](../../problems/smallest-range-i) | [[数学](../math/README.md)] | Easy | +| 906 | [超级回文数](../../problems/super-palindromes) | [[数学](../math/README.md)] | Hard | +| 902 | [最大为 N 的数字组合](../../problems/numbers-at-most-n-given-digit-set) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 899 | [有序队列](../../problems/orderly-queue) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard | +| 892 | [三维形体的表面积](../../problems/surface-area-of-3d-shapes) | [[几何](../geometry/README.md)] [[数学](../math/README.md)] | Easy | +| 891 | [子序列宽度之和](../../problems/sum-of-subsequence-widths) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 887 | [鸡蛋掉落](../../problems/super-egg-drop) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 885 | [螺旋矩阵 III](../../problems/spiral-matrix-iii) | [[数学](../math/README.md)] | Medium | +| 883 | [三维形体投影面积](../../problems/projection-area-of-3d-shapes) | [[数学](../math/README.md)] | Easy | +| 878 | [第 N 个神奇数字](../../problems/nth-magical-number) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 877 | [石子游戏](../../problems/stone-game) | [[极小化极大](../minimax/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 869 | [重新排序得到 2 的幂](../../problems/reordered-power-of-2) | [[数学](../math/README.md)] | Medium | +| 868 | [二进制间距](../../problems/binary-gap) | [[数学](../math/README.md)] | Easy | +| 866 | [回文素数](../../problems/prime-palindrome) | [[数学](../math/README.md)] | Medium | +| 858 | [镜面反射](../../problems/mirror-reflection) | [[数学](../math/README.md)] | Medium | +| 836 | [矩形重叠](../../problems/rectangle-overlap) | [[数学](../math/README.md)] | Easy | +| 829 | [连续整数求和](../../problems/consecutive-numbers-sum) | [[数学](../math/README.md)] | Hard | +| 812 | [最大三角形面积](../../problems/largest-triangle-area) | [[数学](../math/README.md)] | Easy | +| 810 | [黑板异或游戏](../../problems/chalkboard-xor-game) | [[数学](../math/README.md)] | Hard | +| 805 | [数组的均值分割](../../problems/split-array-with-same-average) | [[数学](../math/README.md)] | Hard | +| 800 | [相似 RGB 颜色](../../problems/similar-rgb-color) 🔒 | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy | +| 794 | [有效的井字游戏](../../problems/valid-tic-tac-toe-state) | [[递归](../recursion/README.md)] [[数学](../math/README.md)] | Medium | +| 789 | [逃脱阻碍者](../../problems/escape-the-ghosts) | [[数学](../math/README.md)] | Medium | +| 782 | [变为棋盘](../../problems/transform-to-chessboard) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 781 | [森林中的兔子](../../problems/rabbits-in-forest) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 780 | [到达终点](../../problems/reaching-points) | [[数学](../math/README.md)] | Hard | +| 775 | [全局倒置与局部倒置](../../problems/global-and-local-inversions) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 754 | [到达终点数字](../../problems/reach-a-number) | [[数学](../math/README.md)] | Medium | +| 753 | [破解保险箱](../../problems/cracking-the-safe) | [[深度优先搜索](../depth-first-search/README.md)] [[数学](../math/README.md)] | Hard | +| 728 | [自除数](../../problems/self-dividing-numbers) | [[数学](../math/README.md)] | Easy | +| 672 | [灯泡开关 Ⅱ](../../problems/bulb-switcher-ii) | [[数学](../math/README.md)] | Medium | +| 670 | [最大交换](../../problems/maximum-swap) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 660 | [移除 9](../../problems/remove-9) 🔒 | [[数学](../math/README.md)] | Hard | +| 651 | [4键键盘](../../problems/4-keys-keyboard) 🔒 | [[贪心算法](../greedy/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 645 | [错误的集合](../../problems/set-mismatch) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 640 | [求解方程](../../problems/solve-the-equation) | [[数学](../math/README.md)] | Medium | +| 634 | [寻找数组的错位排列](../../problems/find-the-derangement-of-an-array) 🔒 | [[数学](../math/README.md)] | Medium | +| 633 | [平方数之和](../../problems/sum-of-square-numbers) | [[数学](../math/README.md)] | Medium | +| 628 | [三个数的最大乘积](../../problems/maximum-product-of-three-numbers) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 625 | [最小因式分解](../../problems/minimum-factorization) 🔒 | [[递归](../recursion/README.md)] [[数学](../math/README.md)] | Medium | +| 598 | [范围求和 II](../../problems/range-addition-ii) | [[数学](../math/README.md)] | Easy | +| 593 | [有效的正方形](../../problems/valid-square) | [[数学](../math/README.md)] | Medium | +| 592 | [分数加减运算](../../problems/fraction-addition-and-subtraction) | [[数学](../math/README.md)] | Medium | +| 573 | [松鼠模拟](../../problems/squirrel-simulation) 🔒 | [[数学](../math/README.md)] | Medium | +| 553 | [最优除法](../../problems/optimal-division) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 537 | [复数乘法](../../problems/complex-number-multiplication) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 535 | [TinyURL 的加密与解密](../../problems/encode-and-decode-tinyurl) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 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 | +| 507 | [完美数](../../problems/perfect-number) | [[数学](../math/README.md)] | Easy | +| 492 | [构造矩形](../../problems/construct-the-rectangle) | [[数学](../math/README.md)] | Easy | +| 483 | [最小好进制](../../problems/smallest-good-base) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 478 | [在圆内随机生成点](../../problems/generate-random-point-in-a-circle) | [[数学](../math/README.md)] [[Random](../random/README.md)] [[Rejection Sampling](../rejection-sampling/README.md)] | Medium | +| 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 | +| 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 | +| 413 | [等差数列划分](../../problems/arithmetic-slices) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 400 | [第 N 位数字](../../problems/nth-digit) | [[数学](../math/README.md)] | Medium | +| 397 | [整数替换](../../problems/integer-replacement) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Medium | +| 396 | [旋转函数](../../problems/rotate-function) | [[数学](../math/README.md)] | Medium | +| 372 | [超级次方](../../problems/super-pow) | [[数学](../math/README.md)] | Medium | +| 368 | [最大整除子集](../../problems/largest-divisible-subset) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 367 | [有效的完全平方数](../../problems/valid-perfect-square) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 365 | [水壶问题](../../problems/water-and-jug-problem) | [[数学](../math/README.md)] | Medium | +| 360 | [有序转化数组](../../problems/sort-transformed-array) 🔒 | [[数学](../math/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 357 | [计算各个位数不同的数字个数](../../problems/count-numbers-with-unique-digits) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 356 | [直线镜像](../../problems/line-reflection) 🔒 | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 343 | [整数拆分](../../problems/integer-break) | [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 335 | [路径交叉](../../problems/self-crossing) | [[数学](../math/README.md)] | Hard | +| 326 | [3的幂](../../problems/power-of-three) | [[数学](../math/README.md)] | Easy | +| 319 | [灯泡开关](../../problems/bulb-switcher) | [[脑筋急转弯](../brainteaser/README.md)] [[数学](../math/README.md)] | Medium | +| 313 | [超级丑数](../../problems/super-ugly-number) | [[堆](../heap/README.md)] [[数学](../math/README.md)] | Medium | +| 296 | [最佳的碰头地点](../../problems/best-meeting-point) 🔒 | [[排序](../sort/README.md)] [[数学](../math/README.md)] | Hard | +| 279 | [完全平方数](../../problems/perfect-squares) | [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 273 | [整数转换英文表示](../../problems/integer-to-english-words) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard | +| 268 | [丢失的数字](../../problems/missing-number) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 264 | [丑数 II](../../problems/ugly-number-ii) | [[堆](../heap/README.md)] [[数学](../math/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 263 | [丑数](../../problems/ugly-number) | [[数学](../math/README.md)] | Easy | +| 258 | [各位相加](../../problems/add-digits) | [[数学](../math/README.md)] | Easy | +| 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 | +| 246 | [中心对称数](../../problems/strobogrammatic-number) 🔒 | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 233 | [数字 1 的个数](../../problems/number-of-digit-one) | [[数学](../math/README.md)] | Hard | +| 231 | [2的幂](../../problems/power-of-two) | [[位运算](../bit-manipulation/README.md)] [[数学](../math/README.md)] | Easy | +| 224 | [基本计算器](../../problems/basic-calculator) | [[栈](../stack/README.md)] [[数学](../math/README.md)] | Hard | +| 223 | [矩形面积](../../problems/rectangle-area) | [[数学](../math/README.md)] | Medium | +| 204 | [计数质数](../../problems/count-primes) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 202 | [快乐数](../../problems/happy-number) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Easy | +| 172 | [阶乘后的零](../../problems/factorial-trailing-zeroes) | [[数学](../math/README.md)] | Easy | +| 171 | [Excel表列序号](../../problems/excel-sheet-column-number) | [[数学](../math/README.md)] | Easy | +| 168 | [Excel表列名称](../../problems/excel-sheet-column-title) | [[数学](../math/README.md)] | Easy | +| 166 | [分数到小数](../../problems/fraction-to-recurring-decimal) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Medium | +| 149 | [直线上最多的点数](../../problems/max-points-on-a-line) | [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] | Hard | +| 69 | [x 的平方根](../../problems/sqrtx) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 67 | [二进制求和](../../problems/add-binary) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy | +| 65 | [有效数字](../../problems/valid-number) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Hard | +| 60 | [排列序列](../../problems/permutation-sequence) | [[数学](../math/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 50 | [Pow(x, n)](../../problems/powx-n) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 43 | [字符串相乘](../../problems/multiply-strings) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 29 | [两数相除](../../problems/divide-two-integers) | [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 13 | [罗马数字转整数](../../problems/roman-to-integer) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Easy | +| 12 | [整数转罗马数字](../../problems/integer-to-roman) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 9 | [回文数](../../problems/palindrome-number) | [[数学](../math/README.md)] | Easy | +| 8 | [字符串转换整数 (atoi)](../../problems/string-to-integer-atoi) | [[数学](../math/README.md)] [[字符串](../string/README.md)] | Medium | +| 7 | [整数反转](../../problems/reverse-integer) | [[数学](../math/README.md)] | Easy | +| 2 | [两数相加](../../problems/add-two-numbers) | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] [[数学](../math/README.md)] | Medium | diff --git a/tag/meet-in-the-middle/README.md b/tag/meet-in-the-middle/README.md new file mode 100644 index 000000000..dac9adc9e --- /dev/null +++ b/tag/meet-in-the-middle/README.md @@ -0,0 +1,11 @@ + + + + + + + +## [话题分类](../README.md) > + +| # | 题目 | 标签 | 难度 | +| :-: | - | - | :-: | diff --git a/tag/ordered-map/README.md b/tag/ordered-map/README.md index 85faedb8e..52afd5989 100644 --- a/tag/ordered-map/README.md +++ b/tag/ordered-map/README.md @@ -9,17 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 1675 | [数组的最小偏移量](../../problems/minimize-deviation-in-array) | [[堆](../heap/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 1649 | [通过指令创建有序数组](../../problems/create-sorted-array-through-instructions) | [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 1606 | [找到处理最多请求的服务器](../../problems/find-servers-that-handled-most-number-of-requests) | [[Ordered Map](../ordered-map/README.md)] | Hard | -| 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 | -| 975 | [奇偶跳](../../problems/odd-even-jump) | [[栈](../stack/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 855 | [考场就座](../../problems/exam-room) | [[Ordered Map](../ordered-map/README.md)] | Medium | -| 846 | [一手顺子](../../problems/hand-of-straights) | [[Ordered Map](../ordered-map/README.md)] | Medium | -| 732 | [我的日程安排表 III](../../problems/my-calendar-iii) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 731 | [我的日程安排表 II](../../problems/my-calendar-ii) | [[Ordered Map](../ordered-map/README.md)] | Medium | -| 715 | [Range 模块](../../problems/range-module) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 699 | [掉落的方块](../../problems/falling-squares) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | -| 683 | [K 个关闭的灯泡](../../problems/k-empty-slots) 🔒 | [[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 | -| 220 | [存在重复元素 III](../../problems/contains-duplicate-iii) | [[排序](../sort/README.md)] [[Ordered Map](../ordered-map/README.md)] | Medium | diff --git a/tag/queue/README.md b/tag/queue/README.md index 71e7795da..88fe0bfa0 100644 --- a/tag/queue/README.md +++ b/tag/queue/README.md @@ -19,3 +19,4 @@ | 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 | +| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[队列](../queue/README.md)] | Medium | diff --git a/tag/recursion/README.md b/tag/recursion/README.md index cf753e23c..ad51289a2 100644 --- a/tag/recursion/README.md +++ b/tag/recursion/README.md @@ -37,6 +37,7 @@ | 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 | +| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[队列](../queue/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 | diff --git a/tag/segment-tree/README.md b/tag/segment-tree/README.md index bdf264168..b34d04e3d 100644 --- a/tag/segment-tree/README.md +++ b/tag/segment-tree/README.md @@ -9,3 +9,19 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1687 | [从仓库到码头运输箱子](../../problems/delivering-boxes-from-storage-to-ports) | [[线段树](../segment-tree/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1649 | [通过指令创建有序数组](../../problems/create-sorted-array-through-instructions) | [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 1526 | [形成目标数组的子数组最少增加次数](../../problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array) | [[线段树](../segment-tree/README.md)] | Hard | +| 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 | +| 1353 | [最多可以参加的会议数目](../../problems/maximum-number-of-events-that-can-be-attended) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] [[线段树](../segment-tree/README.md)] | Medium | +| 1157 | [子数组中占绝大多数的元素](../../problems/online-majority-element-in-subarray) | [[线段树](../segment-tree/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 850 | [矩形面积 II](../../problems/rectangle-area-ii) | [[线段树](../segment-tree/README.md)] [[Line Sweep](../line-sweep/README.md)] | Hard | +| 732 | [我的日程安排表 III](../../problems/my-calendar-iii) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 715 | [Range 模块](../../problems/range-module) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 699 | [掉落的方块](../../problems/falling-squares) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/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 | +| 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 | +| 308 | [二维区域和检索 - 可变](../../problems/range-sum-query-2d-mutable) 🔒 | [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] | Hard | +| 307 | [区域和检索 - 数组可修改](../../problems/range-sum-query-mutable) | [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/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 | diff --git a/tag/sliding-window/README.md b/tag/sliding-window/README.md index 56d607bc2..fbbfc5182 100644 --- a/tag/sliding-window/README.md +++ b/tag/sliding-window/README.md @@ -9,30 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 1658 | [将 x 减到 0 的最小操作数](../../problems/minimum-operations-to-reduce-x-to-zero) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1499 | [满足不等式的最大值](../../problems/max-value-of-equation) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | -| 1498 | [满足条件的子序列数目](../../problems/number-of-subsequences-that-satisfy-the-given-sum-condition) | [[排序](../sort/README.md)] [[Sliding Window](../sliding-window/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 | -| 1438 | [绝对差不超过限制的最长连续子数组](../../problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1423 | [可获得的最大点数](../../problems/maximum-points-you-can-obtain-from-cards) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1208 | [尽可能使字符串相等](../../problems/get-equal-substrings-within-budget) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1176 | [健身计划评估](../../problems/diet-plan-performance) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Easy | -| 1151 | [最少交换次数来组合所有的 1](../../problems/minimum-swaps-to-group-all-1s-together) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1100 | [长度为 K 的无重复字符子串](../../problems/find-k-length-substrings-with-no-repeated-characters) 🔒 | [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1074 | [元素和为目标值的子矩阵数量](../../problems/number-of-submatrices-that-sum-to-target) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | -| 1052 | [爱生气的书店老板](../../problems/grumpy-bookstore-owner) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 1040 | [移动石子直到连续 II](../../problems/moving-stones-until-consecutive-ii) | [[数组](../array/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 | -| 995 | [K 连续位的最小翻转次数](../../problems/minimum-number-of-k-consecutive-bit-flips) | [[贪心算法](../greedy/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 | -| 978 | [最长湍流子数组](../../problems/longest-turbulent-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 727 | [最小窗口子序列](../../problems/minimum-window-subsequence) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | -| 567 | [字符串的排列](../../problems/permutation-in-string) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | -| 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)] [[双指针](../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 | -| 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/sort/README.md b/tag/sort/README.md index 3ae174849..49e4c7112 100644 --- a/tag/sort/README.md +++ b/tag/sort/README.md @@ -9,78 +9,3 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | -| 1727 | [重新排列后的最大子矩阵](../../problems/largest-submatrix-with-rearrangements) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium | -| 1710 | [卡车上的最大单元数](../../problems/maximum-units-on-a-truck) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Easy | -| 1697 | [检查边长度限制的路径是否存在](../../problems/checking-existence-of-edge-length-limited-paths) | [[排序](../sort/README.md)] [[并查集](../union-find/README.md)] | Hard | -| 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)] [[哈希表](../hash-table/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 | -| 1229 | [安排会议日程](../../problems/meeting-scheduler) 🔒 | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium | -| 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)] | Medium | -| 56 | [合并区间](../../problems/merge-intervals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | diff --git a/tag/string/README.md b/tag/string/README.md index dabd214b3..9549c364f 100644 --- a/tag/string/README.md +++ b/tag/string/README.md @@ -9,3 +9,222 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1768 | [交替合并字符串](../../problems/merge-strings-alternately) | [[字符串](../string/README.md)] | Easy | +| 1763 | [最长的美好子字符串](../../problems/longest-nice-substring) | [[字符串](../string/README.md)] | Easy | +| 1759 | [统计同构子字符串的数目](../../problems/count-number-of-homogenous-substrings) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium | +| 1745 | [回文串分割 IV](../../problems/palindrome-partitioning-iv) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1737 | [满足三条件之一需改变的最少字符数](../../problems/change-minimum-characters-to-satisfy-one-of-three-conditions) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Medium | +| 1736 | [替换隐藏数字得到的最晚时间](../../problems/latest-time-by-replacing-hidden-digits) | [[贪心算法](../greedy/README.md)] [[字符串](../string/README.md)] | Easy | +| 1704 | [判断字符串的两半是否相似](../../problems/determine-if-string-halves-are-alike) | [[字符串](../string/README.md)] | Easy | +| 1698 | [字符串的不同子字符串个数](../../problems/number-of-distinct-substrings-in-a-string) 🔒 | [[字典树](../trie/README.md)] [[字符串](../string/README.md)] | Medium | +| 1694 | [重新格式化电话号码](../../problems/reformat-phone-number) | [[字符串](../string/README.md)] | Easy | +| 1684 | [统计一致字符串的数目](../../problems/count-the-number-of-consistent-strings) | [[字符串](../string/README.md)] | Easy | +| 1682 | [最长回文子序列 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)] [[二分查找](../binary-search/README.md)] | Medium | +| 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)] [[双指针](../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 | +| 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 4ca263579..3938e0e01 100644 --- a/tag/tags.json +++ b/tag/tags.json @@ -199,6 +199,11 @@ "Slug": "reservoir-sampling", "TranslatedName": "蓄水池抽样" }, + { + "Name": "", + "Slug": "meet-in-the-middle", + "TranslatedName": "" + }, { "Name": "Memoization", "Slug": "memoization", diff --git a/tag/tree/README.md b/tag/tree/README.md index cf7af3ead..b7e90ec33 100644 --- a/tag/tree/README.md +++ b/tag/tree/README.md @@ -9,6 +9,7 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1766 | [互质树](../../problems/tree-of-coprimes) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[数学](../math/README.md)] | Hard | | 1740 | [找到二叉树中的距离](../../problems/find-distance-in-a-binary-tree) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | | 1719 | [重构一棵树的方案数](../../problems/number-of-ways-to-reconstruct-a-tree) | [[树](../tree/README.md)] [[图](../graph/README.md)] | Hard | | 1676 | [二叉树的最近公共祖先 IV](../../problems/lowest-common-ancestor-of-a-binary-tree-iv) 🔒 | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] | Medium | @@ -86,7 +87,7 @@ | 684 | [冗余连接](../../problems/redundant-connection) | [[树](../tree/README.md)] [[并查集](../union-find/README.md)] [[图](../graph/README.md)] | Medium | | 671 | [二叉树中第二小的节点](../../problems/second-minimum-node-in-a-binary-tree) | [[树](../tree/README.md)] | Easy | | 669 | [修剪二叉搜索树](../../problems/trim-a-binary-search-tree) | [[树](../tree/README.md)] [[递归](../recursion/README.md)] | Medium | -| 666 | [路径和 IV](../../problems/path-sum-iv) 🔒 | [[树](../tree/README.md)] | Medium | +| 666 | [路径总和 IV](../../problems/path-sum-iv) 🔒 | [[树](../tree/README.md)] | Medium | | 663 | [均匀树划分](../../problems/equal-tree-partition) 🔒 | [[树](../tree/README.md)] | Medium | | 662 | [二叉树最大宽度](../../problems/maximum-width-of-binary-tree) | [[树](../tree/README.md)] | Medium | | 655 | [输出二叉树](../../problems/print-binary-tree) | [[树](../tree/README.md)] | Medium | @@ -138,7 +139,7 @@ | 230 | [二叉搜索树中第K小的元素](../../problems/kth-smallest-element-in-a-bst) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 226 | [翻转二叉树](../../problems/invert-binary-tree) | [[树](../tree/README.md)] | Easy | | 222 | [完全二叉树的节点个数](../../problems/count-complete-tree-nodes) | [[树](../tree/README.md)] [[二分查找](../binary-search/README.md)] | Medium | -| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] | Medium | +| 199 | [二叉树的右视图](../../problems/binary-tree-right-side-view) | [[树](../tree/README.md)] [[深度优先搜索](../depth-first-search/README.md)] [[广度优先搜索](../breadth-first-search/README.md)] [[递归](../recursion/README.md)] [[队列](../queue/README.md)] | Medium | | 173 | [二叉搜索树迭代器](../../problems/binary-search-tree-iterator) | [[栈](../stack/README.md)] [[树](../tree/README.md)] [[设计](../design/README.md)] | Medium | | 156 | [上下翻转二叉树](../../problems/binary-tree-upside-down) 🔒 | [[树](../tree/README.md)] | Medium | | 145 | [二叉树的后序遍历](../../problems/binary-tree-postorder-traversal) | [[栈](../stack/README.md)] [[树](../tree/README.md)] | Medium | @@ -153,7 +154,7 @@ | 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)] [[递归](../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)] | Medium | | 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 | diff --git a/tag/two-pointers/README.md b/tag/two-pointers/README.md index e14c8fe4e..461770ab9 100644 --- a/tag/two-pointers/README.md +++ b/tag/two-pointers/README.md @@ -9,6 +9,7 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1750 | [删除字符串两端相同字符后的最短长度](../../problems/minimum-length-of-string-after-deleting-similar-ends) | [[双指针](../two-pointers/README.md)] | Medium | | 1712 | [将数组分成三个子数组的方案数](../../problems/ways-to-split-array-into-three-subarrays) | [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | | 1711 | [大餐计数](../../problems/count-good-meals) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | | 1695 | [删除子数组的最大得分](../../problems/maximum-erasure-value) | [[双指针](../two-pointers/README.md)] | Medium | From 32e298b1177a4bff770804564ccad1b7fbe4967e Mon Sep 17 00:00:00 2001 From: Shuo Date: Wed, 24 Feb 2021 16:25:15 +0800 Subject: [PATCH 2/3] A: tag --- .../README.md | 2 +- tag/README.md | 6 +- tag/array/README.md | 310 ++++++++++++++++++ tag/dequeue/README.md | 2 +- tag/dynamic-programming/README.md | 248 ++++++++++++++ tag/geometry/README.md | 9 + tag/line-sweep/README.md | 6 + tag/linked-list/README.md | 43 +++ tag/meet-in-the-middle/README.md | 2 +- tag/oop/README.md | 2 +- tag/ordered-map/README.md | 14 + tag/sliding-window/README.md | 27 ++ tag/sort/README.md | 75 +++++ tag/tags.json | 12 +- 14 files changed, 745 insertions(+), 13 deletions(-) diff --git a/problems/average-of-levels-in-binary-tree/README.md b/problems/average-of-levels-in-binary-tree/README.md index 14a2b4973..da85b7d73 100644 --- a/problems/average-of-levels-in-binary-tree/README.md +++ b/problems/average-of-levels-in-binary-tree/README.md @@ -38,4 +38,4 @@ The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 ### Similar Questions 1. [Binary Tree Level Order Traversal](../binary-tree-level-order-traversal) (Medium) - 1. [Binary Tree Level Order Traversal II](../binary-tree-level-order-traversal-ii) (Easy) + 1. [Binary Tree Level Order Traversal II](../binary-tree-level-order-traversal-ii) (Medium) diff --git a/tag/README.md b/tag/README.md index d5c45a064..a81c4006c 100644 --- a/tag/README.md +++ b/tag/README.md @@ -26,8 +26,8 @@ | 29 | [Minimax](minimax/README.md) | [极小化极大](https://openset.github.io/tags/minimax/) | | 30 | [Binary Indexed Tree](binary-indexed-tree/README.md) | [树状数组](https://openset.github.io/tags/binary-indexed-tree/) | | 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/) | +| 35 | [Binary Search Tree](binary-search-tree/README.md) | [二叉搜索树](https://openset.github.io/tags/binary-search-tree/) | | 36 | [Dequeue](dequeue/README.md) | [Dequeue](https://openset.github.io/tags/dequeue/) | | 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 | [](meet-in-the-middle/README.md) | [](https://openset.github.io/tags/meet-in-the-middle/) | | 42 | [Memoization](memoization/README.md) | [记忆化](https://openset.github.io/tags/memoization/) | -| 43 | [](oop/README.md) | [](https://openset.github.io/tags/oop/) | \ No newline at end of file +| 41 | [Meet In The Middle](meet-in-the-middle/README.md) | [Meet In The Middle](https://openset.github.io/tags/meet-in-the-middle/) | | 42 | [Memoization](memoization/README.md) | [记忆化](https://openset.github.io/tags/memoization/) | +| 43 | [OOP](oop/README.md) | [OOP](https://openset.github.io/tags/oop/) | \ No newline at end of file diff --git a/tag/array/README.md b/tag/array/README.md index b22899942..f39e14f91 100644 --- a/tag/array/README.md +++ b/tag/array/README.md @@ -9,3 +9,313 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1769 | [移动所有球到每个盒子所需的最小操作数](../../problems/minimum-number-of-operations-to-move-all-balls-to-each-box) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1764 | [通过连接另一个数组的子数组得到一个数组](../../problems/form-array-by-concatenating-subarrays-of-another-array) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1758 | [生成交替二进制字符串的最少操作数](../../problems/minimum-changes-to-make-alternating-binary-string) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Easy | +| 1756 | [Design Most Recently Used Queue](../../problems/design-most-recently-used-queue) 🔒 | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | +| 1752 | [检查数组是否经排序和轮转得到](../../problems/check-if-array-is-sorted-and-rotated) | [[数组](../array/README.md)] | Easy | +| 1748 | [唯一元素的和](../../problems/sum-of-unique-elements) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1742 | [盒子中小球的最大数量](../../problems/maximum-number-of-balls-in-a-box) | [[数组](../array/README.md)] | Easy | +| 1738 | [找出第 K 大的异或坐标值](../../problems/find-kth-largest-xor-coordinate-value) | [[数组](../array/README.md)] | Medium | +| 1733 | [需要教语言的最少人数](../../problems/minimum-number-of-people-to-teach) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1732 | [找到最高海拔](../../problems/find-the-highest-altitude) | [[数组](../array/README.md)] | Easy | +| 1726 | [同积元组](../../problems/tuple-with-same-product) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1711 | [大餐计数](../../problems/count-good-meals) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 1708 | [长度为 K 的最大子数组](../../problems/largest-subarray-length-k) 🔒 | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Easy | +| 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 | +| 1646 | [获取生成数组中的最大值](../../problems/get-maximum-in-generated-array) | [[数组](../array/README.md)] | Easy | +| 1640 | [能否连接形成数组](../../problems/check-array-formation-through-concatenation) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1636 | [按照频率将数组升序排序](../../problems/sort-array-by-increasing-frequency) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy | +| 1629 | [按键持续时间最长的键](../../problems/slowest-key) | [[数组](../array/README.md)] | Easy | +| 1619 | [删除某些元素后的数组均值](../../problems/mean-of-array-after-removing-some-elements) | [[数组](../array/README.md)] | Easy | +| 1608 | [特殊数组的特征值](../../problems/special-array-with-x-elements-greater-than-or-equal-x) | [[数组](../array/README.md)] | Easy | +| 1590 | [使数组和能被 P 整除](../../problems/make-sum-divisible-by-p) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1588 | [所有奇数长度子数组的和](../../problems/sum-of-all-odd-length-subarrays) | [[数组](../array/README.md)] | Easy | +| 1583 | [统计不开心的朋友](../../problems/count-unhappy-friends) | [[数组](../array/README.md)] | Medium | +| 1582 | [二进制矩阵中的特殊位置](../../problems/special-positions-in-a-binary-matrix) | [[数组](../array/README.md)] | Easy | +| 1574 | [删除最短的子数组使剩余数组有序](../../problems/shortest-subarray-to-be-removed-to-make-array-sorted) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1572 | [矩阵对角线元素的和](../../problems/matrix-diagonal-sum) | [[数组](../array/README.md)] | Easy | +| 1570 | [两个稀疏向量的点积](../../problems/dot-product-of-two-sparse-vectors) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 1566 | [重复至少 K 次且长度为 M 的模式](../../problems/detect-pattern-of-length-m-repeated-k-or-more-times) | [[数组](../array/README.md)] | Easy | +| 1560 | [圆形赛道上经过次数最多的扇区](../../problems/most-visited-sector-in-a-circular-track) | [[数组](../array/README.md)] | Easy | +| 1552 | [两球之间的磁力](../../problems/magnetic-force-between-two-balls) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1550 | [存在连续三个奇数的数组](../../problems/three-consecutive-odds) | [[数组](../array/README.md)] | Easy | +| 1539 | [第 k 个缺失的正整数](../../problems/kth-missing-positive-number) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1535 | [找出数组游戏的赢家](../../problems/find-the-winner-of-an-array-game) | [[数组](../array/README.md)] | Medium | +| 1534 | [统计好三元组](../../problems/count-good-triplets) | [[数组](../array/README.md)] | Easy | +| 1524 | [和为奇数的子数组数目](../../problems/number-of-sub-arrays-with-odd-sum) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1512 | [好数对的数目](../../problems/number-of-good-pairs) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] [[数学](../math/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 | +| 1503 | [所有蚂蚁掉下来前的最后一刻](../../problems/last-moment-before-all-ants-fall-out-of-a-plank) | [[脑筋急转弯](../brainteaser/README.md)] [[数组](../array/README.md)] | Medium | +| 1502 | [判断能否形成等差数列](../../problems/can-make-arithmetic-progression-from-sequence) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy | +| 1500 | [设计文件分享系统](../../problems/design-a-file-sharing-system) 🔒 | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | +| 1499 | [满足不等式的最大值](../../problems/max-value-of-equation) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 1497 | [检查数组对是否可以被 k 整除](../../problems/check-if-array-pairs-are-divisible-by-k) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1493 | [删掉一个元素以后全为 1 的最长子数组](../../problems/longest-subarray-of-1s-after-deleting-one-element) | [[数组](../array/README.md)] | Medium | +| 1491 | [去掉最低工资和最高工资后的工资平均值](../../problems/average-salary-excluding-the-minimum-and-maximum-salary) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy | +| 1488 | [避免洪水泛滥](../../problems/avoid-flood-in-the-city) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1486 | [数组异或操作](../../problems/xor-operation-in-an-array) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] | Easy | +| 1482 | [制作 m 束花所需的最少天数](../../problems/minimum-number-of-days-to-make-m-bouquets) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1481 | [不同整数的最少数目](../../problems/least-number-of-unique-integers-after-k-removals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1480 | [一维数组的动态和](../../problems/running-sum-of-1d-array) | [[数组](../array/README.md)] | Easy | +| 1476 | [子矩形查询](../../problems/subrectangle-queries) | [[数组](../array/README.md)] | Medium | +| 1475 | [商品折扣后的最终价格](../../problems/final-prices-with-a-special-discount-in-a-shop) | [[数组](../array/README.md)] | Easy | +| 1471 | [数组中的 k 个最强值](../../problems/the-k-strongest-values-in-an-array) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1470 | [重新排列数组](../../problems/shuffle-the-array) | [[数组](../array/README.md)] | Easy | +| 1465 | [切割后面积最大的蛋糕](../../problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts) | [[数组](../array/README.md)] | Medium | +| 1464 | [数组中两元素的最大乘积](../../problems/maximum-product-of-two-elements-in-an-array) | [[数组](../array/README.md)] | Easy | +| 1460 | [通过翻转子数组使两个数组相等](../../problems/make-two-arrays-equal-by-reversing-sub-arrays) | [[数组](../array/README.md)] | Easy | +| 1450 | [在既定时间做作业的学生人数](../../problems/number-of-students-doing-homework-at-a-given-time) | [[数组](../array/README.md)] | Easy | +| 1442 | [形成两个异或相等数组的三元组数目](../../problems/count-triplets-that-can-form-two-arrays-of-equal-xor) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1438 | [绝对差不超过限制的最长连续子数组](../../problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1437 | [是否所有 1 都至少相隔 k 个元素](../../problems/check-if-all-1s-are-at-least-length-k-places-away) | [[数组](../array/README.md)] | Easy | +| 1431 | [拥有最多糖果的孩子](../../problems/kids-with-the-greatest-number-of-candies) | [[数组](../array/README.md)] | Easy | +| 1428 | [至少有一个 1 的最左端列](../../problems/leftmost-column-with-at-least-a-one) 🔒 | [[数组](../array/README.md)] | Medium | +| 1427 | [字符串的左右移](../../problems/perform-string-shifts) 🔒 | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1426 | [数元素](../../problems/counting-elements) 🔒 | [[数组](../array/README.md)] | Easy | +| 1424 | [对角线遍历 II](../../problems/diagonal-traverse-ii) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1423 | [可获得的最大点数](../../problems/maximum-points-you-can-obtain-from-cards) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1414 | [和为 K 的最少斐波那契数字数目](../../problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1413 | [逐步求和得到正数的最小值](../../problems/minimum-value-to-get-positive-step-by-step-sum) | [[数组](../array/README.md)] | Easy | +| 1409 | [查询带键的排列](../../problems/queries-on-a-permutation-with-key) | [[数组](../array/README.md)] | Medium | +| 1399 | [统计最大组的数目](../../problems/count-largest-group) | [[数组](../array/README.md)] | Easy | +| 1395 | [统计作战单位数](../../problems/count-number-of-teams) | [[数组](../array/README.md)] | Medium | +| 1394 | [找出数组中的幸运数](../../problems/find-lucky-integer-in-an-array) | [[数组](../array/README.md)] | Easy | +| 1389 | [按既定顺序创建目标数组](../../problems/create-target-array-in-the-given-order) | [[数组](../array/README.md)] | Easy | +| 1386 | [安排电影院座位](../../problems/cinema-seat-allocation) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1385 | [两个数组间的距离值](../../problems/find-the-distance-value-between-two-arrays) | [[数组](../array/README.md)] | Easy | +| 1380 | [矩阵中的幸运数](../../problems/lucky-numbers-in-a-matrix) | [[数组](../array/README.md)] | Easy | +| 1375 | [灯泡开关 III](../../problems/bulb-switcher-iii) | [[数组](../array/README.md)] | Medium | +| 1366 | [通过投票对团队排名](../../problems/rank-teams-by-votes) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1365 | [有多少小于当前数字的数字](../../problems/how-many-numbers-are-smaller-than-the-current-number) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1352 | [最后 K 个数的乘积](../../problems/product-of-the-last-k-numbers) | [[设计](../design/README.md)] [[数组](../array/README.md)] | Medium | +| 1351 | [统计有序矩阵中的负数](../../problems/count-negative-numbers-in-a-sorted-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 1346 | [检查整数及其两倍数是否存在](../../problems/check-if-n-and-its-double-exist) | [[数组](../array/README.md)] | Easy | +| 1343 | [大小为 K 且平均值大于等于阈值的子数组数目](../../problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold) | [[数组](../array/README.md)] | Medium | +| 1338 | [数组大小减半](../../problems/reduce-array-size-to-the-half) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1337 | [矩阵中战斗力最弱的 K 行](../../problems/the-k-weakest-rows-in-a-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 1333 | [餐厅过滤器](../../problems/filter-restaurants-by-vegan-friendly-price-and-distance) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1331 | [数组序号转换](../../problems/rank-transform-of-an-array) | [[数组](../array/README.md)] | Easy | +| 1330 | [翻转子数组得到最大的数组值](../../problems/reverse-subarray-to-maximize-array-value) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 1329 | [将矩阵按对角线排序](../../problems/sort-the-matrix-diagonally) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 1313 | [解压缩编码列表](../../problems/decompress-run-length-encoded-list) | [[数组](../array/README.md)] | Easy | +| 1304 | [和为零的N个唯一整数](../../problems/find-n-unique-integers-sum-up-to-zero) | [[数组](../array/README.md)] | Easy | +| 1300 | [转变数组后最接近目标值的数组和](../../problems/sum-of-mutated-array-closest-to-target) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1299 | [将每个元素替换为右侧最大元素](../../problems/replace-elements-with-greatest-element-on-right-side) | [[数组](../array/README.md)] | Easy | +| 1296 | [划分数组为连续数字的集合](../../problems/divide-array-in-sets-of-k-consecutive-numbers) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1295 | [统计位数为偶数的数字](../../problems/find-numbers-with-even-number-of-digits) | [[数组](../array/README.md)] | Easy | +| 1292 | [元素和小于等于阈值的正方形的最大边长](../../problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1287 | [有序数组中出现次数超过25%的元素](../../problems/element-appearing-more-than-25-in-sorted-array) | [[数组](../array/README.md)] | Easy | +| 1277 | [统计全为 1 的正方形子矩阵](../../problems/count-square-submatrices-with-all-ones) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1275 | [找出井字棋的获胜者](../../problems/find-winner-on-a-tic-tac-toe-game) | [[数组](../array/README.md)] | Easy | +| 1267 | [统计参与通信的服务器](../../problems/count-servers-that-communicate) | [[图](../graph/README.md)] [[数组](../array/README.md)] | Medium | +| 1266 | [访问所有点的最小时间](../../problems/minimum-time-visiting-all-points) | [[几何](../geometry/README.md)] [[数组](../array/README.md)] | Easy | +| 1260 | [二维网格迁移](../../problems/shift-2d-grid) | [[数组](../array/README.md)] | Easy | +| 1252 | [奇数值单元格的数目](../../problems/cells-with-odd-values-in-a-matrix) | [[数组](../array/README.md)] | Easy | +| 1243 | [数组变换](../../problems/array-transformation) 🔒 | [[数组](../array/README.md)] | Easy | +| 1233 | [删除子文件夹](../../problems/remove-sub-folders-from-the-filesystem) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium | +| 1232 | [缀点成线](../../problems/check-if-it-is-a-straight-line) | [[几何](../geometry/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1222 | [可以攻击国王的皇后](../../problems/queens-that-can-attack-the-king) | [[数组](../array/README.md)] | Medium | +| 1217 | [玩筹码](../../problems/minimum-cost-to-move-chips-to-the-same-position) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 1208 | [尽可能使字符串相等](../../problems/get-equal-substrings-within-budget) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1202 | [交换字符串中的元素](../../problems/smallest-string-with-swaps) | [[并查集](../union-find/README.md)] [[数组](../array/README.md)] | Medium | +| 1200 | [最小绝对差](../../problems/minimum-absolute-difference) | [[数组](../array/README.md)] | Easy | +| 1185 | [一周中的第几天](../../problems/day-of-the-week) | [[数组](../array/README.md)] | Easy | +| 1184 | [公交站间的距离](../../problems/distance-between-bus-stops) | [[数组](../array/README.md)] | Easy | +| 1177 | [构建回文串检测](../../problems/can-make-palindrome-from-substring) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium | +| 1176 | [健身计划评估](../../problems/diet-plan-performance) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Easy | +| 1170 | [比较字符串最小字母出现频次](../../problems/compare-strings-by-frequency-of-the-smallest-character) | [[数组](../array/README.md)] [[字符串](../string/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1169 | [查询无效交易](../../problems/invalid-transactions) | [[数组](../array/README.md)] [[字符串](../string/README.md)] | Medium | +| 1160 | [拼写单词](../../problems/find-words-that-can-be-formed-by-characters) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1157 | [子数组中占绝大多数的元素](../../problems/online-majority-element-in-subarray) | [[线段树](../segment-tree/README.md)] [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 1152 | [用户网站访问行为分析](../../problems/analyze-user-website-visit-pattern) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 1151 | [最少交换次数来组合所有的 1](../../problems/minimum-swaps-to-group-all-1s-together) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1150 | [检查一个数是否在数组中占绝大多数](../../problems/check-if-a-number-is-majority-element-in-a-sorted-array) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 1146 | [快照数组](../../problems/snapshot-array) | [[数组](../array/README.md)] | Medium | +| 1144 | [递减元素使数组呈锯齿状](../../problems/decrease-elements-to-make-array-zigzag) | [[数组](../array/README.md)] | Medium | +| 1133 | [最大唯一数](../../problems/largest-unique-number) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1128 | [等价多米诺骨牌对的数量](../../problems/number-of-equivalent-domino-pairs) | [[数组](../array/README.md)] | Easy | +| 1122 | [数组的相对排序](../../problems/relative-sort-array) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy | +| 1109 | [航班预订统计](../../problems/corporate-flight-bookings) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 1099 | [小于 K 的两数之和](../../problems/two-sum-less-than-k) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | +| 1089 | [复写零](../../problems/duplicate-zeros) | [[数组](../array/README.md)] | Easy | +| 1086 | [前五科的均分](../../problems/high-five) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 1085 | [最小元素各数位之和](../../problems/sum-of-digits-in-the-minimum-number) 🔒 | [[数组](../array/README.md)] | Easy | +| 1074 | [元素和为目标值的子矩阵数量](../../problems/number-of-submatrices-that-sum-to-target) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 1064 | [不动点](../../problems/fixed-point) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Easy | +| 1053 | [交换一次的先前排列](../../problems/previous-permutation-with-one-swap) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1052 | [爱生气的书店老板](../../problems/grumpy-bookstore-owner) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1051 | [高度检查器](../../problems/height-checker) | [[数组](../array/README.md)] | Easy | +| 1040 | [移动石子直到连续 II](../../problems/moving-stones-until-consecutive-ii) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1035 | [不相交的线](../../problems/uncrossed-lines) | [[数组](../array/README.md)] | Medium | +| 1031 | [两个非重叠子数组的最大和](../../problems/maximum-sum-of-two-non-overlapping-subarrays) | [[数组](../array/README.md)] | Medium | +| 1018 | [可被 5 整除的二进制前缀](../../problems/binary-prefix-divisible-by-5) | [[数组](../array/README.md)] | Easy | +| 1014 | [最佳观光组合](../../problems/best-sightseeing-pair) | [[数组](../array/README.md)] | Medium | +| 1013 | [将数组分成和相等的三个部分](../../problems/partition-array-into-three-parts-with-equal-sum) | [[数组](../array/README.md)] | Easy | +| 1011 | [在 D 天内送达包裹的能力](../../problems/capacity-to-ship-packages-within-d-days) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 1010 | [总持续时间可被 60 整除的歌曲](../../problems/pairs-of-songs-with-total-durations-divisible-by-60) | [[数组](../array/README.md)] | Medium | +| 1007 | [行相等的最少多米诺旋转](../../problems/minimum-domino-rotations-for-equal-row) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 1002 | [查找常用字符](../../problems/find-common-characters) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 999 | [可以被一步捕获的棋子数](../../problems/available-captures-for-rook) | [[数组](../array/README.md)] | Easy | +| 989 | [数组形式的整数加法](../../problems/add-to-array-form-of-integer) | [[数组](../array/README.md)] | Easy | +| 985 | [查询后的偶数和](../../problems/sum-of-even-numbers-after-queries) | [[数组](../array/README.md)] | Easy | +| 978 | [最长湍流子数组](../../problems/longest-turbulent-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 977 | [有序数组的平方](../../problems/squares-of-a-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | +| 974 | [和可被 K 整除的子数组](../../problems/subarray-sums-divisible-by-k) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 969 | [煎饼排序](../../problems/pancake-sorting) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 962 | [最大宽度坡](../../problems/maximum-width-ramp) | [[数组](../array/README.md)] | Medium | +| 954 | [二倍数对数组](../../problems/array-of-doubled-pairs) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 950 | [按递增顺序显示卡牌](../../problems/reveal-cards-in-increasing-order) | [[数组](../array/README.md)] | Medium | +| 945 | [使数组唯一的最小增量](../../problems/minimum-increment-to-make-array-unique) | [[数组](../array/README.md)] | Medium | +| 941 | [有效的山脉数组](../../problems/valid-mountain-array) | [[数组](../array/README.md)] | Easy | +| 926 | [将字符串翻转到单调递增](../../problems/flip-string-to-monotone-increasing) | [[数组](../array/README.md)] | Medium | +| 922 | [按奇偶排序数组 II](../../problems/sort-array-by-parity-ii) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Easy | +| 918 | [环形子数组的最大和](../../problems/maximum-sum-circular-subarray) | [[数组](../array/README.md)] | Medium | +| 915 | [分割数组](../../problems/partition-array-into-disjoint-intervals) | [[数组](../array/README.md)] | Medium | +| 914 | [卡牌分组](../../problems/x-of-a-kind-in-a-deck-of-cards) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 907 | [子数组的最小值之和](../../problems/sum-of-subarray-minimums) | [[栈](../stack/README.md)] [[数组](../array/README.md)] | Medium | +| 905 | [按奇偶排序数组](../../problems/sort-array-by-parity) | [[数组](../array/README.md)] | Easy | +| 900 | [RLE 迭代器](../../problems/rle-iterator) | [[数组](../array/README.md)] | Medium | +| 896 | [单调数列](../../problems/monotonic-array) | [[数组](../array/README.md)] | Easy | +| 891 | [子序列宽度之和](../../problems/sum-of-subsequence-widths) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 888 | [公平的糖果棒交换](../../problems/fair-candy-swap) | [[数组](../array/README.md)] | Easy | +| 873 | [最长的斐波那契子序列的长度](../../problems/length-of-longest-fibonacci-subsequence) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 870 | [优势洗牌](../../problems/advantage-shuffle) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 867 | [转置矩阵](../../problems/transpose-matrix) | [[数组](../array/README.md)] | Easy | +| 849 | [到最近的人的最大距离](../../problems/maximize-distance-to-closest-person) | [[数组](../array/README.md)] | Medium | +| 840 | [矩阵中的幻方](../../problems/magic-squares-in-grid) | [[数组](../array/README.md)] | Medium | +| 835 | [图像重叠](../../problems/image-overlap) | [[数组](../array/README.md)] | Medium | +| 832 | [翻转图像](../../problems/flipping-an-image) | [[数组](../array/README.md)] | Easy | +| 830 | [较大分组的位置](../../problems/positions-of-large-groups) | [[数组](../array/README.md)] | Easy | +| 825 | [适龄的朋友](../../problems/friends-of-appropriate-ages) | [[数组](../array/README.md)] | Medium | +| 795 | [区间子数组个数](../../problems/number-of-subarrays-with-bounded-maximum) | [[数组](../array/README.md)] | Medium | +| 792 | [匹配子序列的单词数](../../problems/number-of-matching-subsequences) | [[数组](../array/README.md)] | Medium | +| 782 | [变为棋盘](../../problems/transform-to-chessboard) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Hard | +| 775 | [全局倒置与局部倒置](../../problems/global-and-local-inversions) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 769 | [最多能完成排序的块](../../problems/max-chunks-to-make-sorted) | [[数组](../array/README.md)] | Medium | +| 768 | [最多能完成排序的块 II](../../problems/max-chunks-to-make-sorted-ii) | [[数组](../array/README.md)] | Hard | +| 766 | [托普利茨矩阵](../../problems/toeplitz-matrix) | [[数组](../array/README.md)] | Easy | +| 755 | [倒水](../../problems/pour-water) 🔒 | [[数组](../array/README.md)] | Medium | +| 747 | [至少是其他数字两倍的最大数](../../problems/largest-number-at-least-twice-of-others) | [[数组](../array/README.md)] | Easy | +| 746 | [使用最小花费爬楼梯](../../problems/min-cost-climbing-stairs) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy | +| 729 | [我的日程安排表 I](../../problems/my-calendar-i) | [[数组](../array/README.md)] | Medium | +| 724 | [寻找数组的中心索引](../../problems/find-pivot-index) | [[数组](../array/README.md)] | Easy | +| 723 | [粉碎糖果](../../problems/candy-crush) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 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 | +| 717 | [1比特与2比特字符](../../problems/1-bit-and-2-bit-characters) | [[数组](../array/README.md)] | Easy | +| 714 | [买卖股票的最佳时机含手续费](../../problems/best-time-to-buy-and-sell-stock-with-transaction-fee) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 713 | [乘积小于K的子数组](../../problems/subarray-product-less-than-k) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 697 | [数组的度](../../problems/degree-of-an-array) | [[数组](../array/README.md)] | Easy | +| 695 | [岛屿的最大面积](../../problems/max-area-of-island) | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 689 | [三个无重叠子数组的最大和](../../problems/maximum-sum-of-3-non-overlapping-subarrays) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 674 | [最长连续递增序列](../../problems/longest-continuous-increasing-subsequence) | [[数组](../array/README.md)] | Easy | +| 670 | [最大交换](../../problems/maximum-swap) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Medium | +| 667 | [优美的排列 II](../../problems/beautiful-arrangement-ii) | [[数组](../array/README.md)] | Medium | +| 665 | [非递减数列](../../problems/non-decreasing-array) | [[数组](../array/README.md)] | Easy | +| 661 | [图片平滑器](../../problems/image-smoother) | [[数组](../array/README.md)] | Easy | +| 644 | [子数组最大平均数 II](../../problems/maximum-average-subarray-ii) 🔒 | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Hard | +| 643 | [子数组最大平均数 I](../../problems/maximum-average-subarray-i) | [[数组](../array/README.md)] | Easy | +| 628 | [三个数的最大乘积](../../problems/maximum-product-of-three-numbers) | [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 624 | [数组列表中的最大距离](../../problems/maximum-distance-in-arrays) 🔒 | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 621 | [任务调度器](../../problems/task-scheduler) | [[贪心算法](../greedy/README.md)] [[队列](../queue/README.md)] [[数组](../array/README.md)] | Medium | +| 611 | [有效三角形的个数](../../problems/valid-triangle-number) | [[数组](../array/README.md)] | Medium | +| 605 | [种花问题](../../problems/can-place-flowers) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Easy | +| 581 | [最短无序连续子数组](../../problems/shortest-unsorted-continuous-subarray) | [[数组](../array/README.md)] | Medium | +| 566 | [重塑矩阵](../../problems/reshape-the-matrix) | [[数组](../array/README.md)] | Easy | +| 565 | [数组嵌套](../../problems/array-nesting) | [[数组](../array/README.md)] | Medium | +| 562 | [矩阵中最长的连续1线段](../../problems/longest-line-of-consecutive-one-in-matrix) 🔒 | [[数组](../array/README.md)] | Medium | +| 561 | [数组拆分 I](../../problems/array-partition-i) | [[数组](../array/README.md)] | Easy | +| 560 | [和为K的子数组](../../problems/subarray-sum-equals-k) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Medium | +| 548 | [将数组分割成和相等的子数组](../../problems/split-array-with-equal-sum) 🔒 | [[数组](../array/README.md)] | Medium | +| 533 | [孤独像素 II](../../problems/lonely-pixel-ii) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 532 | [数组中的 k-diff 数对](../../problems/k-diff-pairs-in-an-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 531 | [孤独像素 I](../../problems/lonely-pixel-i) 🔒 | [[深度优先搜索](../depth-first-search/README.md)] [[数组](../array/README.md)] | Medium | +| 509 | [斐波那契数](../../problems/fibonacci-number) | [[数组](../array/README.md)] | Easy | +| 495 | [提莫攻击](../../problems/teemo-attacking) | [[数组](../array/README.md)] | Medium | +| 485 | [最大连续 1 的个数](../../problems/max-consecutive-ones) | [[数组](../array/README.md)] | Easy | +| 457 | [环形数组循环](../../problems/circular-array-loop) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 448 | [找到所有数组中消失的数字](../../problems/find-all-numbers-disappeared-in-an-array) | [[数组](../array/README.md)] | Easy | +| 442 | [数组中重复的数据](../../problems/find-all-duplicates-in-an-array) | [[数组](../array/README.md)] | Medium | +| 414 | [第三大的数](../../problems/third-maximum-number) | [[数组](../array/README.md)] | Easy | +| 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 | +| 370 | [区间加法](../../problems/range-addition) 🔒 | [[数组](../array/README.md)] | Medium | +| 289 | [生命游戏](../../problems/game-of-life) | [[数组](../array/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 | +| 280 | [摆动排序](../../problems/wiggle-sort) 🔒 | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 277 | [搜寻名人](../../problems/find-the-celebrity) 🔒 | [[数组](../array/README.md)] | Medium | +| 268 | [丢失的数字](../../problems/missing-number) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[数学](../math/README.md)] | Easy | +| 259 | [较小的三数之和](../../problems/3sum-smaller) 🔒 | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 245 | [最短单词距离 III](../../problems/shortest-word-distance-iii) 🔒 | [[数组](../array/README.md)] | Medium | +| 243 | [最短单词距离](../../problems/shortest-word-distance) 🔒 | [[数组](../array/README.md)] | Easy | +| 238 | [除自身以外数组的乘积](../../problems/product-of-array-except-self) | [[数组](../array/README.md)] | Medium | +| 229 | [求众数 II](../../problems/majority-element-ii) | [[数组](../array/README.md)] | Medium | +| 228 | [汇总区间](../../problems/summary-ranges) | [[数组](../array/README.md)] | Easy | +| 219 | [存在重复元素 II](../../problems/contains-duplicate-ii) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 217 | [存在重复元素](../../problems/contains-duplicate) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | +| 216 | [组合总和 III](../../problems/combination-sum-iii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 209 | [长度最小的子数组](../../problems/minimum-size-subarray-sum) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 189 | [旋转数组](../../problems/rotate-array) | [[数组](../array/README.md)] | Medium | +| 169 | [多数元素](../../problems/majority-element) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/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 | +| 163 | [缺失的区间](../../problems/missing-ranges) 🔒 | [[数组](../array/README.md)] | Easy | +| 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 | +| 153 | [寻找旋转排序数组中的最小值](../../problems/find-minimum-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 152 | [乘积最大子数组](../../problems/maximum-product-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Medium | +| 128 | [最长连续序列](../../problems/longest-consecutive-sequence) | [[并查集](../union-find/README.md)] [[数组](../array/README.md)] | Hard | +| 126 | [单词接龙 II](../../problems/word-ladder-ii) | [[广度优先搜索](../breadth-first-search/README.md)] [[数组](../array/README.md)] [[字符串](../string/README.md)] [[回溯算法](../backtracking/README.md)] | Hard | +| 123 | [买卖股票的最佳时机 III](../../problems/best-time-to-buy-and-sell-stock-iii) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 122 | [买卖股票的最佳时机 II](../../problems/best-time-to-buy-and-sell-stock-ii) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Easy | +| 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 | +| 119 | [杨辉三角 II](../../problems/pascals-triangle-ii) | [[数组](../array/README.md)] | Easy | +| 118 | [杨辉三角](../../problems/pascals-triangle) | [[数组](../array/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 | +| 90 | [子集 II](../../problems/subsets-ii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 88 | [合并两个有序数组](../../problems/merge-sorted-array) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Easy | +| 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 | +| 81 | [搜索旋转排序数组 II](../../problems/search-in-rotated-sorted-array-ii) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 80 | [删除排序数组中的重复项 II](../../problems/remove-duplicates-from-sorted-array-ii) | [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 79 | [单词搜索](../../problems/word-search) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 78 | [子集](../../problems/subsets) | [[位运算](../bit-manipulation/README.md)] [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 75 | [颜色分类](../../problems/sort-colors) | [[排序](../sort/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] | Medium | +| 74 | [搜索二维矩阵](../../problems/search-a-2d-matrix) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 73 | [矩阵置零](../../problems/set-matrix-zeroes) | [[数组](../array/README.md)] | Medium | +| 66 | [加一](../../problems/plus-one) | [[数组](../array/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 | +| 59 | [螺旋矩阵 II](../../problems/spiral-matrix-ii) | [[数组](../array/README.md)] | Medium | +| 57 | [插入区间](../../problems/insert-interval) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 56 | [合并区间](../../problems/merge-intervals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | +| 55 | [跳跃游戏](../../problems/jump-game) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Medium | +| 54 | [螺旋矩阵](../../problems/spiral-matrix) | [[数组](../array/README.md)] | Medium | +| 53 | [最大子序和](../../problems/maximum-subarray) | [[数组](../array/README.md)] [[分治算法](../divide-and-conquer/README.md)] [[动态规划](../dynamic-programming/README.md)] | Easy | +| 48 | [旋转图像](../../problems/rotate-image) | [[数组](../array/README.md)] | Medium | +| 45 | [跳跃游戏 II](../../problems/jump-game-ii) | [[贪心算法](../greedy/README.md)] [[数组](../array/README.md)] | Hard | +| 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 41 | [缺失的第一个正数](../../problems/first-missing-positive) | [[数组](../array/README.md)] | Hard | +| 40 | [组合总和 II](../../problems/combination-sum-ii) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 39 | [组合总和](../../problems/combination-sum) | [[数组](../array/README.md)] [[回溯算法](../backtracking/README.md)] | Medium | +| 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 | +| 33 | [搜索旋转排序数组](../../problems/search-in-rotated-sorted-array) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] | Medium | +| 31 | [下一个排列](../../problems/next-permutation) | [[数组](../array/README.md)] | Medium | +| 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 | +| 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 | +| 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 | +| 4 | [寻找两个正序数组的中位数](../../problems/median-of-two-sorted-arrays) | [[数组](../array/README.md)] [[二分查找](../binary-search/README.md)] [[分治算法](../divide-and-conquer/README.md)] | Hard | +| 1 | [两数之和](../../problems/two-sum) | [[数组](../array/README.md)] [[哈希表](../hash-table/README.md)] | Easy | diff --git a/tag/dequeue/README.md b/tag/dequeue/README.md index dac9adc9e..337f59d12 100644 --- a/tag/dequeue/README.md +++ b/tag/dequeue/README.md @@ -5,7 +5,7 @@ -## [话题分类](../README.md) > +## [话题分类](../README.md) > Dequeue | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | diff --git a/tag/dynamic-programming/README.md b/tag/dynamic-programming/README.md index 882b2c7e5..012e08c38 100644 --- a/tag/dynamic-programming/README.md +++ b/tag/dynamic-programming/README.md @@ -9,3 +9,251 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1771 | [由子序列构造的最长回文串的长度](../../problems/maximize-palindrome-length-from-subsequences) | [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1770 | [执行乘法运算的最大分数](../../problems/maximum-score-from-performing-multiplication-operations) | [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1751 | [最多可以参加的会议数目 II](../../problems/maximum-number-of-events-that-can-be-attended-ii) | [[二分查找](../binary-search/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1746 | [Maximum Subarray Sum After One Operation](../../problems/maximum-subarray-sum-after-one-operation) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1745 | [回文串分割 IV](../../problems/palindrome-partitioning-iv) | [[字符串](../string/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1728 | [猫和老鼠 II](../../problems/cat-and-mouse-ii) | [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1724 | [检查边长度限制的路径是否存在 II](../../problems/checking-existence-of-edge-length-limited-paths-ii) 🔒 | [[并查集](../union-find/README.md)] [[图](../graph/README.md)] [[动态规划](../dynamic-programming/README.md)] | Hard | +| 1706 | [球会落何处](../../problems/where-will-the-ball-fall) | [[动态规划](../dynamic-programming/README.md)] | Medium | +| 1692 | [计算分配糖果的不同方式](../../problems/count-ways-to-distribute-candies) 🔒 | [[动态规划](../dynamic-programming/README.md)] | Hard | +| 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 | [最长回文子序列 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) | [[哈希表](../hash-table/README.md)] [[数学](../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 | [解码方法 II](../../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)] | Medium | +| 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 | +| 42 | [接雨水](../../problems/trapping-rain-water) | [[栈](../stack/README.md)] [[数组](../array/README.md)] [[双指针](../two-pointers/README.md)] [[动态规划](../dynamic-programming/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 | diff --git a/tag/geometry/README.md b/tag/geometry/README.md index 5a8521ed2..085448301 100644 --- a/tag/geometry/README.md +++ b/tag/geometry/README.md @@ -9,3 +9,12 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 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/line-sweep/README.md b/tag/line-sweep/README.md index 592ea3e0f..932db1472 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) 🔒 | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] [[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..8103f6eff 100644 --- a/tag/linked-list/README.md +++ b/tag/linked-list/README.md @@ -9,3 +9,46 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1721 | [交换链表中的节点](../../problems/swapping-nodes-in-a-linked-list) | [[链表](../linked-list/README.md)] | Medium | +| 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) | [[递归](../recursion/README.md)] [[链表](../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) | [[递归](../recursion/README.md)] [[链表](../linked-list/README.md)] [[数学](../math/README.md)] | Medium | diff --git a/tag/meet-in-the-middle/README.md b/tag/meet-in-the-middle/README.md index dac9adc9e..e22e2978d 100644 --- a/tag/meet-in-the-middle/README.md +++ b/tag/meet-in-the-middle/README.md @@ -5,7 +5,7 @@ -## [话题分类](../README.md) > +## [话题分类](../README.md) > Meet In The Middle | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | diff --git a/tag/oop/README.md b/tag/oop/README.md index dac9adc9e..4871b5c65 100644 --- a/tag/oop/README.md +++ b/tag/oop/README.md @@ -5,7 +5,7 @@ -## [话题分类](../README.md) > +## [话题分类](../README.md) > OOP | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | diff --git a/tag/ordered-map/README.md b/tag/ordered-map/README.md index 52afd5989..85faedb8e 100644 --- a/tag/ordered-map/README.md +++ b/tag/ordered-map/README.md @@ -9,3 +9,17 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1675 | [数组的最小偏移量](../../problems/minimize-deviation-in-array) | [[堆](../heap/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 1649 | [通过指令创建有序数组](../../problems/create-sorted-array-through-instructions) | [[树状数组](../binary-indexed-tree/README.md)] [[线段树](../segment-tree/README.md)] [[二分查找](../binary-search/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 1606 | [找到处理最多请求的服务器](../../problems/find-servers-that-handled-most-number-of-requests) | [[Ordered Map](../ordered-map/README.md)] | Hard | +| 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 | +| 975 | [奇偶跳](../../problems/odd-even-jump) | [[栈](../stack/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 855 | [考场就座](../../problems/exam-room) | [[Ordered Map](../ordered-map/README.md)] | Medium | +| 846 | [一手顺子](../../problems/hand-of-straights) | [[Ordered Map](../ordered-map/README.md)] | Medium | +| 732 | [我的日程安排表 III](../../problems/my-calendar-iii) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 731 | [我的日程安排表 II](../../problems/my-calendar-ii) | [[Ordered Map](../ordered-map/README.md)] | Medium | +| 715 | [Range 模块](../../problems/range-module) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 699 | [掉落的方块](../../problems/falling-squares) | [[线段树](../segment-tree/README.md)] [[Ordered Map](../ordered-map/README.md)] | Hard | +| 683 | [K 个关闭的灯泡](../../problems/k-empty-slots) 🔒 | [[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 | +| 220 | [存在重复元素 III](../../problems/contains-duplicate-iii) | [[排序](../sort/README.md)] [[Ordered Map](../ordered-map/README.md)] | Medium | diff --git a/tag/sliding-window/README.md b/tag/sliding-window/README.md index fbbfc5182..56d607bc2 100644 --- a/tag/sliding-window/README.md +++ b/tag/sliding-window/README.md @@ -9,3 +9,30 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1658 | [将 x 减到 0 的最小操作数](../../problems/minimum-operations-to-reduce-x-to-zero) | [[贪心算法](../greedy/README.md)] [[双指针](../two-pointers/README.md)] [[二分查找](../binary-search/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1499 | [满足不等式的最大值](../../problems/max-value-of-equation) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 1498 | [满足条件的子序列数目](../../problems/number-of-subsequences-that-satisfy-the-given-sum-condition) | [[排序](../sort/README.md)] [[Sliding Window](../sliding-window/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 | +| 1438 | [绝对差不超过限制的最长连续子数组](../../problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1423 | [可获得的最大点数](../../problems/maximum-points-you-can-obtain-from-cards) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1208 | [尽可能使字符串相等](../../problems/get-equal-substrings-within-budget) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1176 | [健身计划评估](../../problems/diet-plan-performance) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Easy | +| 1151 | [最少交换次数来组合所有的 1](../../problems/minimum-swaps-to-group-all-1s-together) 🔒 | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1100 | [长度为 K 的无重复字符子串](../../problems/find-k-length-substrings-with-no-repeated-characters) 🔒 | [[字符串](../string/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1074 | [元素和为目标值的子矩阵数量](../../problems/number-of-submatrices-that-sum-to-target) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 1052 | [爱生气的书店老板](../../problems/grumpy-bookstore-owner) | [[数组](../array/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 1040 | [移动石子直到连续 II](../../problems/moving-stones-until-consecutive-ii) | [[数组](../array/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 | +| 995 | [K 连续位的最小翻转次数](../../problems/minimum-number-of-k-consecutive-bit-flips) | [[贪心算法](../greedy/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 | +| 978 | [最长湍流子数组](../../problems/longest-turbulent-subarray) | [[数组](../array/README.md)] [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 727 | [最小窗口子序列](../../problems/minimum-window-subsequence) 🔒 | [[动态规划](../dynamic-programming/README.md)] [[Sliding Window](../sliding-window/README.md)] | Hard | +| 567 | [字符串的排列](../../problems/permutation-in-string) | [[双指针](../two-pointers/README.md)] [[Sliding Window](../sliding-window/README.md)] | Medium | +| 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)] [[双指针](../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 | +| 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/sort/README.md b/tag/sort/README.md index 49e4c7112..3ae174849 100644 --- a/tag/sort/README.md +++ b/tag/sort/README.md @@ -9,3 +9,78 @@ | # | 题目 | 标签 | 难度 | | :-: | - | - | :-: | +| 1727 | [重新排列后的最大子矩阵](../../problems/largest-submatrix-with-rearrangements) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Medium | +| 1710 | [卡车上的最大单元数](../../problems/maximum-units-on-a-truck) | [[贪心算法](../greedy/README.md)] [[排序](../sort/README.md)] | Easy | +| 1697 | [检查边长度限制的路径是否存在](../../problems/checking-existence-of-edge-length-limited-paths) | [[排序](../sort/README.md)] [[并查集](../union-find/README.md)] | Hard | +| 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)] [[哈希表](../hash-table/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 | +| 1229 | [安排会议日程](../../problems/meeting-scheduler) 🔒 | [[排序](../sort/README.md)] [[双指针](../two-pointers/README.md)] [[Line Sweep](../line-sweep/README.md)] | Medium | +| 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)] | Medium | +| 56 | [合并区间](../../problems/merge-intervals) | [[排序](../sort/README.md)] [[数组](../array/README.md)] | Medium | diff --git a/tag/tags.json b/tag/tags.json index 3938e0e01..a01a1babe 100644 --- a/tag/tags.json +++ b/tag/tags.json @@ -175,9 +175,9 @@ "TranslatedName": "二叉搜索树" }, { - "Name": "", + "Name": "Dequeue", "Slug": "dequeue", - "TranslatedName": "" + "TranslatedName": "Dequeue" }, { "Name": "Rolling Hash", @@ -200,9 +200,9 @@ "TranslatedName": "蓄水池抽样" }, { - "Name": "", + "Name": "Meet In The Middle", "Slug": "meet-in-the-middle", - "TranslatedName": "" + "TranslatedName": "Meet In The Middle" }, { "Name": "Memoization", @@ -210,8 +210,8 @@ "TranslatedName": "记忆化" }, { - "Name": "", + "Name": "OOP", "Slug": "oop", - "TranslatedName": "" + "TranslatedName": "OOP" } ] \ No newline at end of file From 51c2064e2df8f0623df756b5c679ce78947fae78 Mon Sep 17 00:00:00 2001 From: Shuo Date: Wed, 24 Feb 2021 16:42:09 +0800 Subject: [PATCH 3/3] U: string() --- problems/base-7/base_7.go | 4 +++- .../excel-sheet-column-title/excel_sheet_column_title.go | 8 +++++--- problems/find-common-characters/find_common_characters.go | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/problems/base-7/base_7.go b/problems/base-7/base_7.go index eb5d7b6fb..a33edf3b2 100644 --- a/problems/base-7/base_7.go +++ b/problems/base-7/base_7.go @@ -1,5 +1,7 @@ package problem504 +import "fmt" + func convertToBase7(num int) string { ans := "" if num < 0 { @@ -8,5 +10,5 @@ func convertToBase7(num int) string { if num >= 7 { ans += convertToBase7(num / 7) } - return ans + string('0'+num%7) + return ans + fmt.Sprintf("%c", '0'+num%7) } diff --git a/problems/excel-sheet-column-title/excel_sheet_column_title.go b/problems/excel-sheet-column-title/excel_sheet_column_title.go index 4e739214f..60a5e5e20 100644 --- a/problems/excel-sheet-column-title/excel_sheet_column_title.go +++ b/problems/excel-sheet-column-title/excel_sheet_column_title.go @@ -1,11 +1,13 @@ package problem168 +import "fmt" + // Solution 1: recursive func convertToTitle(n int) string { if n--; n < 26 { - return string(n + 'A') + return fmt.Sprintf("%c", n+'A') } - return convertToTitle(n/26) + string(n%26+'A') + return convertToTitle(n/26) + fmt.Sprintf("%c", n%26+'A') } // Solution 2: iteration @@ -13,7 +15,7 @@ func convertToTitle2(n int) string { ans := "" for ; n > 0; n /= 26 { n-- - ans = string(n%26+'A') + ans + ans = fmt.Sprintf("%c", n%26+'A') + ans } return ans } diff --git a/problems/find-common-characters/find_common_characters.go b/problems/find-common-characters/find_common_characters.go index 5582457b7..468ed7a6d 100644 --- a/problems/find-common-characters/find_common_characters.go +++ b/problems/find-common-characters/find_common_characters.go @@ -1,5 +1,7 @@ package problem1002 +import "fmt" + func commonChars(A []string) []string { ans, m, l := make([]string, 0), make([][26]int, len(A)), len(A) for i, str := range A { @@ -19,7 +21,7 @@ func commonChars(A []string) []string { } } if c >= 0 { - ans = append(ans, string(i+'a')) + ans = append(ans, fmt.Sprintf("%c", i+'a')) } } }