From 81806ae8026a27b14ebdee83bb589ac34d7be278 Mon Sep 17 00:00:00 2001 From: openset Date: Fri, 11 Oct 2019 11:33:15 +0800 Subject: [PATCH] Update: daily update --- README.md | 2 +- problems/additive-number/README.md | 28 +++++++++++----- problems/alphabet-board-path/README.md | 15 +++++++++ problems/binary-tree-coloring-game/README.md | 11 +++++++ problems/brace-expansion-ii/README.md | 8 ++--- problems/building-h2o/README.md | 8 +++-- problems/bulls-and-cows/README.md | 2 +- problems/corporate-flight-bookings/README.md | 4 +++ problems/count-vowels-permutation/README.md | 5 ++- .../README.md | 3 ++ .../README.md | 7 ++-- problems/day-of-the-week/README.md | 3 ++ problems/day-of-the-year/README.md | 2 +- .../README.md | 6 ++++ problems/defanging-an-ip-address/README.md | 3 ++ .../delete-nodes-and-return-forest/README.md | 4 +++ problems/distance-between-bus-stops/README.md | 3 ++ .../find-all-anagrams-in-a-string/README.md | 2 +- .../README.md | 14 +++++--- problems/increasing-subsequences/README.md | 22 +++++++------ .../README.md | 2 +- problems/invalid-transactions/README.md | 2 +- .../k-concatenation-maximum-sum/README.md | 3 ++ problems/largest-1-bordered-square/README.md | 14 ++++++++ .../README.md | 2 +- problems/lfu-cache/README.md | 21 +++++++----- .../README.md | 24 ++++++++++++-- .../README.md | 11 +++++++ problems/longest-common-subsequence/README.md | 3 ++ .../README.md | 33 +++++++++++-------- .../README.md | 14 +++++++- .../README.md | 16 +++++++++ .../make-array-strictly-increasing/README.md | 3 ++ .../README.md | 2 +- .../README.md | 4 +++ problems/maximum-number-of-balloons/README.md | 4 +++ .../README.md | 10 ++++++ .../README.md | 3 ++ .../README.md | 16 +++++++++ .../README.md | 5 ++- problems/n-th-tribonacci-number/README.md | 14 ++++++++ problems/non-overlapping-intervals/README.md | 29 +++++++--------- problems/nth-digit/README.md | 2 +- .../README.md | 9 +++++ .../README.md | 14 ++++++++ .../README.md | 31 +++++++++++++++++ problems/path-with-maximum-gold/README.md | 11 ++++++- problems/permutation-in-string/README.md | 2 +- problems/play-with-chips/README.md | 30 +++++++++++++++-- problems/print-zero-even-odd/README.md | 2 +- .../queue-reconstruction-by-height/README.md | 13 ++++---- problems/reformat-department-table/README.md | 2 +- .../README.md | 5 ++- .../README.md | 11 ++++--- problems/robot-bounded-in-circle/README.md | 2 +- .../shortest-common-supersequence/README.md | 6 ++-- .../shortest-path-in-binary-matrix/README.md | 13 ++++++-- .../README.md | 10 ++++++ .../README.md | 2 +- .../README.md | 5 +-- problems/smallest-sufficient-team/README.md | 12 +++++++ .../README.md | 32 +++++++++++------- problems/stepping-numbers/README.md | 2 +- problems/stone-game-ii/README.md | 9 +++++ .../README.md | 2 +- problems/two-sum-bsts/README.md | 2 +- .../unique-number-of-occurrences/README.md | 5 ++- problems/valid-palindrome-iii/README.md | 2 +- tag/array/README.md | 11 +++++-- tag/backtracking/README.md | 3 +- tag/binary-search-tree/README.md | 2 +- tag/binary-search/README.md | 2 ++ tag/bit-manipulation/README.md | 1 + tag/breadth-first-search/README.md | 2 ++ tag/depth-first-search/README.md | 2 ++ tag/design/README.md | 1 + tag/dynamic-programming/README.md | 12 ++++++- tag/graph/README.md | 1 + tag/greedy/README.md | 2 ++ tag/hash-table/README.md | 11 ++++--- tag/math/README.md | 9 +++-- tag/recursion/README.md | 1 + tag/segment-tree/README.md | 1 + tag/sliding-window/README.md | 3 +- tag/stack/README.md | 3 ++ tag/string/README.md | 10 ++++-- tag/tree/README.md | 2 ++ tag/two-pointers/README.md | 4 +-- 88 files changed, 554 insertions(+), 152 deletions(-) diff --git a/README.md b/README.md index 657d3855c..770dbb6ef 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ LeetCode Problems' Solutions | 1182 | [Shortest Distance to Target Color](https://leetcode.com/problems/shortest-distance-to-target-color "与目标颜色间的最短距离") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/shortest-distance-to-target-color) | Medium | | 1181 | [Before and After Puzzle](https://leetcode.com/problems/before-and-after-puzzle "前后拼接") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/before-and-after-puzzle) | Medium | | 1180 | [Count Substrings with Only One Distinct Letter](https://leetcode.com/problems/count-substrings-with-only-one-distinct-letter "统计只含单一字母的子串") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/count-substrings-with-only-one-distinct-letter) | Easy | -| 1179 | [Reformat Department Table](https://leetcode.com/problems/reformat-department-table) | [MySQL](https://github.com/openset/leetcode/tree/master/problems/reformat-department-table) | Easy | +| 1179 | [Reformat Department Table](https://leetcode.com/problems/reformat-department-table "重新格式化部门表") | [MySQL](https://github.com/openset/leetcode/tree/master/problems/reformat-department-table) | Easy | | 1178 | [Number of Valid Words for Each Puzzle](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle "猜字谜") | [Go](https://github.com/openset/leetcode/tree/master/problems/number-of-valid-words-for-each-puzzle) | Hard | | 1177 | [Can Make Palindrome from Substring](https://leetcode.com/problems/can-make-palindrome-from-substring "构建回文串检测") | [Go](https://github.com/openset/leetcode/tree/master/problems/can-make-palindrome-from-substring) | Medium | | 1176 | [Diet Plan Performance](https://leetcode.com/problems/diet-plan-performance "健身计划评估") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/diet-plan-performance) | Easy | diff --git a/problems/additive-number/README.md b/problems/additive-number/README.md index c3d4f3380..142fdc4a5 100644 --- a/problems/additive-number/README.md +++ b/problems/additive-number/README.md @@ -19,22 +19,32 @@

Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 03 or 1, 02, 3 is invalid.

-

Example 1:

+

 

+

Example 1:

-Input: "112358"
-Output: true 
-Explanation: The digits can form an additive sequence: 1, 1, 2, 3, 5, 8. 
+Input: "112358"
+Output: true
+Explanation: The digits can form an additive sequence: 1, 1, 2, 3, 5, 8. 
              1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8
 
-

Example 2:

+

Example 2:

-Input: "199100199"
-Output: true 
-Explanation: The additive sequence is: 1, 99, 100, 199. 
-             1 + 99 = 100, 99 + 100 = 199
+Input: "199100199" +Output: true +Explanation: The additive sequence is: 1, 99, 100, 199.  +  1 + 99 = 100, 99 + 100 = 199 + + +

 

+

Constraints:

+ +

Follow up:
How would you handle overflow for very large input integers?

diff --git a/problems/alphabet-board-path/README.md b/problems/alphabet-board-path/README.md index 9169fcb53..61aa1efa8 100644 --- a/problems/alphabet-board-path/README.md +++ b/problems/alphabet-board-path/README.md @@ -46,3 +46,18 @@
  • 1 <= target.length <= 100
  • target consists only of English lowercase letters.
  • + +### Related Topics + [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] + [[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] + +### Hints +
    +Hint 1 +Create a hashmap from letter to position on the board. +
    + +
    +Hint 2 +Now for each letter, try moving there in steps, where at each step you check if it is inside the boundaries of the board. +
    diff --git a/problems/binary-tree-coloring-game/README.md b/problems/binary-tree-coloring-game/README.md index 67f8b1efa..6ce16d729 100644 --- a/problems/binary-tree-coloring-game/README.md +++ b/problems/binary-tree-coloring-game/README.md @@ -42,3 +42,14 @@ ### Related Topics [[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] + +### Hints +
    +Hint 1 +The best move y must be immediately adjacent to x, since it locks out that subtree. +
    + +
    +Hint 2 +Can you count each of (up to) 3 different subtrees neighboring x? +
    diff --git a/problems/brace-expansion-ii/README.md b/problems/brace-expansion-ii/README.md index f9ee8ffd1..e6cd3207b 100644 --- a/problems/brace-expansion-ii/README.md +++ b/problems/brace-expansion-ii/README.md @@ -31,7 +31,7 @@
  • When we concatenate two expressions, we take the set of possible concatenations between two words where the first word comes from the first expression and the second word comes from the second expression.
  • @@ -52,8 +52,8 @@

    Example 1:

    -Input: "{a,b}{c{d,e}}"
    -Output: ["acd","ace","bcd","bce"]
    +Input: "{a,b}{c,{d,e}}"
    +Output: ["ac","ad","ae","bc","bd","be"]
     
    @@ -70,7 +70,7 @@

    Constraints:

      -
    1. 1 <= expression.length <= 50
    2. +
    3. 1 <= expression.length <= 60
    4. expression[i] consists of '{', '}', ','or lowercase English letters.
    5. The given expression represents a set of words based on the grammar given in the description.
    diff --git a/problems/building-h2o/README.md b/problems/building-h2o/README.md index 4523e0e46..1967f5aff 100644 --- a/problems/building-h2o/README.md +++ b/problems/building-h2o/README.md @@ -9,9 +9,9 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/number-of-days-in-a-month "Number of Days in a Month") -## [1117. Building H2O (Hard)](https://leetcode.com/problems/building-h2o "H2O 生成") +## [1117. Building H2O (Medium)](https://leetcode.com/problems/building-h2o "H2O 生成") -

    There are two kinds of threads, oxygen and hydrogen. Your goal is to group these threads to form water molecules. There is a barrier where each thread has to wait until a complete molecule can be formed. Hydrogen and oxygen threads will be given a releaseHydrogen and releaseOxygen method respectfully, which will allow them to pass the barrier. These threads should pass the barrier in groups of three, and they must be able to immediately bond with each other to form a water molecule. You must guarantee that all the threads from one molecule bond before any other threads from the next molecule do.

    +

    There are two kinds of threads, oxygen and hydrogen. Your goal is to group these threads to form water molecules. There is a barrier where each thread has to wait until a complete molecule can be formed. Hydrogen and oxygen threads will be given releaseHydrogen and releaseOxygen methods respectively, which will allow them to pass the barrier. These threads should pass the barrier in groups of three, and they must be able to immediately bond with each other to form a water molecule. You must guarantee that all the threads from one molecule bond before any other threads from the next molecule do.

    In other words:

    @@ -20,6 +20,8 @@
  • If a hydrogen thread arrives at the barrier when no other threads are present, it has to wait for an oxygen thread and another hydrogen thread.
  • +

    We don’t have to worry about matching the threads up explicitly; that is, the threads do not necessarily know which other threads they are paired up with. The key is just that threads pass the barrier in complete sets; thus, if we examine the sequence of threads that bond and divide them into groups of three, each group should contain one oxygen and two hydrogen threads.

    +

    Write synchronization code for oxygen and hydrogen molecules that enforces these constraints.

    @@ -50,7 +52,7 @@

    Constraints:

      -
    • Total length of input string will be 3n, where 1 ≤ n ≤ 50.
    • +
    • Total length of input string will be 3n, where 1 ≤ n ≤ 20.
    • Total number of H will be 2n in the input string.
    • Total number of O will be n in the input string.
    diff --git a/problems/bulls-and-cows/README.md b/problems/bulls-and-cows/README.md index 146da6f8c..8986f0056 100644 --- a/problems/bulls-and-cows/README.md +++ b/problems/bulls-and-cows/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/longest-increasing-subsequence "Longest Increasing Subsequence") -## [299. Bulls and Cows (Medium)](https://leetcode.com/problems/bulls-and-cows "猜数字游戏") +## [299. Bulls and Cows (Easy)](https://leetcode.com/problems/bulls-and-cows "猜数字游戏")

    You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called "bulls") and how many digits match the secret number but locate in the wrong position (called "cows"). Your friend will use successive guesses and hints to eventually derive the secret number.

    diff --git a/problems/corporate-flight-bookings/README.md b/problems/corporate-flight-bookings/README.md index ec52c9ad7..876e2dcef 100644 --- a/problems/corporate-flight-bookings/README.md +++ b/problems/corporate-flight-bookings/README.md @@ -33,3 +33,7 @@
  • 1 <= bookings[i][0] <= bookings[i][1] <= n <= 20000
  • 1 <= bookings[i][2] <= 10000
  • + +### Related Topics + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + [[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] diff --git a/problems/count-vowels-permutation/README.md b/problems/count-vowels-permutation/README.md index bfeb1988a..5c3a17ed8 100644 --- a/problems/count-vowels-permutation/README.md +++ b/problems/count-vowels-permutation/README.md @@ -9,7 +9,7 @@                  Next > -## [5216. Count Vowels Permutation (Hard)](https://leetcode.com/problems/count-vowels-permutation "统计元音字母序列的数目") +## [1220. Count Vowels Permutation (Hard)](https://leetcode.com/problems/count-vowels-permutation "统计元音字母序列的数目")

    Given an integer n, your task is to count how many strings of length n can be formed under the following rules:

    @@ -54,6 +54,9 @@ Next >
  • 1 <= n <= 2 * 10^4
  • +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + ### Hints
    Hint 1 diff --git a/problems/critical-connections-in-a-network/README.md b/problems/critical-connections-in-a-network/README.md index bcb36859c..6443eb367 100644 --- a/problems/critical-connections-in-a-network/README.md +++ b/problems/critical-connections-in-a-network/README.md @@ -38,6 +38,9 @@
  • There are no repeated connections.
  • +### Related Topics + [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] + ### Hints
    Hint 1 diff --git a/problems/data-stream-as-disjoint-intervals/README.md b/problems/data-stream-as-disjoint-intervals/README.md index 00b7ba5f1..d76f5d428 100644 --- a/problems/data-stream-as-disjoint-intervals/README.md +++ b/problems/data-stream-as-disjoint-intervals/README.md @@ -23,10 +23,11 @@ [1, 3], [6, 7] -

    Follow up:
    -What if there are lots of merges and the number of disjoint intervals are small compared to the data stream's size?

    +

     

    -

    NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature.

    +

    Follow up:

    + +

    What if there are lots of merges and the number of disjoint intervals are small compared to the data stream's size?

    ### Related Topics [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] diff --git a/problems/day-of-the-week/README.md b/problems/day-of-the-week/README.md index 2dc9e3411..bac1cd003 100644 --- a/problems/day-of-the-week/README.md +++ b/problems/day-of-the-week/README.md @@ -46,6 +46,9 @@
  • The given dates are valid dates between the years 1971 and 2100.
  • +### Related Topics + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + ### Hints
    Hint 1 diff --git a/problems/day-of-the-year/README.md b/problems/day-of-the-year/README.md index 34f9b79b4..7c4e65130 100644 --- a/problems/day-of-the-year/README.md +++ b/problems/day-of-the-year/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/number-of-dice-rolls-with-target-sum "Number of Dice Rolls With Target Sum") -## [1154. Day of the Year (Easy)](https://leetcode.com/problems/day-of-the-year "") +## [1154. Day of the Year (Easy)](https://leetcode.com/problems/day-of-the-year "一年中的第几天")

    Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.

    diff --git a/problems/decrease-elements-to-make-array-zigzag/README.md b/problems/decrease-elements-to-make-array-zigzag/README.md index ab811dfdb..89d266149 100644 --- a/problems/decrease-elements-to-make-array-zigzag/README.md +++ b/problems/decrease-elements-to-make-array-zigzag/README.md @@ -48,3 +48,9 @@ ### Related Topics [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + +### Hints +
    +Hint 1 +Do each case (even indexed is greater, odd indexed is greater) separately. In say the even case, you should decrease each even-indexed element until it is lower than its immediate neighbors. +
    diff --git a/problems/defanging-an-ip-address/README.md b/problems/defanging-an-ip-address/README.md index ee99c84bd..df01ada1a 100644 --- a/problems/defanging-an-ip-address/README.md +++ b/problems/defanging-an-ip-address/README.md @@ -29,3 +29,6 @@
    • The given address is a valid IPv4 address.
    + +### Related Topics + [[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] diff --git a/problems/delete-nodes-and-return-forest/README.md b/problems/delete-nodes-and-return-forest/README.md index ed19b1c24..f6c02ef41 100644 --- a/problems/delete-nodes-and-return-forest/README.md +++ b/problems/delete-nodes-and-return-forest/README.md @@ -36,3 +36,7 @@
  • to_delete.length <= 1000
  • to_delete contains distinct values between 1 and 1000.
  • + +### Related Topics + [[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] + [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] diff --git a/problems/distance-between-bus-stops/README.md b/problems/distance-between-bus-stops/README.md index f823e5b1d..5cc1a7a56 100644 --- a/problems/distance-between-bus-stops/README.md +++ b/problems/distance-between-bus-stops/README.md @@ -61,6 +61,9 @@
  • 0 <= distance[i] <= 10^4
  • +### Related Topics + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + ### Hints
    Hint 1 diff --git a/problems/find-all-anagrams-in-a-string/README.md b/problems/find-all-anagrams-in-a-string/README.md index e73b41b27..06a8f41f8 100644 --- a/problems/find-all-anagrams-in-a-string/README.md +++ b/problems/find-all-anagrams-in-a-string/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/ternary-expression-parser "Ternary Expression Parser") -## [438. Find All Anagrams in a String (Easy)](https://leetcode.com/problems/find-all-anagrams-in-a-string "找到字符串中所有字母异位词") +## [438. Find All Anagrams in a String (Medium)](https://leetcode.com/problems/find-all-anagrams-in-a-string "找到字符串中所有字母异位词")

    Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.

    diff --git a/problems/get-equal-substrings-within-budget/README.md b/problems/get-equal-substrings-within-budget/README.md index fba94c8c7..9b88f63e4 100644 --- a/problems/get-equal-substrings-within-budget/README.md +++ b/problems/get-equal-substrings-within-budget/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/remove-all-adjacent-duplicates-in-string-ii "Remove All Adjacent Duplicates in String II") -## [5207. Get Equal Substrings Within Budget (Medium)](https://leetcode.com/problems/get-equal-substrings-within-budget "尽可能使字符串相等") +## [1208. Get Equal Substrings Within Budget (Medium)](https://leetcode.com/problems/get-equal-substrings-within-budget "尽可能使字符串相等")

    You are given two strings s and t of the same length. You want to change s to t. Changing the i-th character of s to i-th character of t costs |s[i] - t[i]| that is, the absolute difference between the ASCII values of the characters.

    @@ -23,22 +23,22 @@

    Example 1:

    -Input: s = "abcd", t = "bcdf", cost = 3
    +Input: s = "abcd", t = "bcdf", maxCost = 3
     Output: 3
     Explanation: "abc" of s can change to "bcd". That costs 3, so the maximum length is 3.

    Example 2:

    -Input: s = "abcd", t = "cdef", cost = 3
    +Input: s = "abcd", t = "cdef", maxCost = 3
     Output: 1
    -Explanation: Each charactor in s costs 2 to change to charactor in t, so the maximum length is 1.
    +Explanation: Each character in s costs 2 to change to charactor in t, so the maximum length is 1.
     

    Example 3:

    -Input: s = "abcd", t = "acde", cost = 0
    +Input: s = "abcd", t = "acde", maxCost = 0
     Output: 1
     Explanation: You can't make any change, so the maximum length is 1.
     
    @@ -52,6 +52,10 @@
  • s and t only contain lower case English letters.
  • +### Related Topics + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] + ### Hints
    Hint 1 diff --git a/problems/increasing-subsequences/README.md b/problems/increasing-subsequences/README.md index 853458ab5..dc241a1ce 100644 --- a/problems/increasing-subsequences/README.md +++ b/problems/increasing-subsequences/README.md @@ -11,24 +11,26 @@ ## [491. Increasing Subsequences (Medium)](https://leetcode.com/problems/increasing-subsequences "递增子序列") -

    -Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 . -

    +

    Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2.

    + +

     

    + +

    Example:

    -

    Example:

     Input: [4, 6, 7, 7]
     Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]
     
    -

    -

    Note:
    +

     

    + +

    Note:

    +
      -
    1. The length of the given array will not exceed 15.
    2. -
    3. The range of integer in the given array is [-100,100].
    4. -
    5. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
    6. +
    7. The length of the given array will not exceed 15.
    8. +
    9. The range of integer in the given array is [-100,100].
    10. +
    11. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
    -

    ### Related Topics [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] diff --git a/problems/intersection-of-three-sorted-arrays/README.md b/problems/intersection-of-three-sorted-arrays/README.md index bf2a38a6e..1047c1ba3 100644 --- a/problems/intersection-of-three-sorted-arrays/README.md +++ b/problems/intersection-of-three-sorted-arrays/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/two-sum-bsts "Two Sum BSTs") -## [5079. Intersection of Three Sorted Arrays (Easy)](https://leetcode.com/problems/intersection-of-three-sorted-arrays "三个有序数组的交集") +## [1213. Intersection of Three Sorted Arrays (Easy)](https://leetcode.com/problems/intersection-of-three-sorted-arrays "三个有序数组的交集")

    Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays.

    diff --git a/problems/invalid-transactions/README.md b/problems/invalid-transactions/README.md index e30804e9a..8b4fb7a99 100644 --- a/problems/invalid-transactions/README.md +++ b/problems/invalid-transactions/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/compare-strings-by-frequency-of-the-smallest-character "Compare Strings by Frequency of the Smallest Character") -## [1169. Invalid Transactions (Easy)](https://leetcode.com/problems/invalid-transactions "查询无效交易") +## [1169. Invalid Transactions (Medium)](https://leetcode.com/problems/invalid-transactions "查询无效交易")

    A transaction is possibly invalid if:

    diff --git a/problems/k-concatenation-maximum-sum/README.md b/problems/k-concatenation-maximum-sum/README.md index 5a02076b0..a369f31d3 100644 --- a/problems/k-concatenation-maximum-sum/README.md +++ b/problems/k-concatenation-maximum-sum/README.md @@ -50,6 +50,9 @@
  • -10^4 <= arr[i] <= 10^4
  • +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + ### Hints
    Hint 1 diff --git a/problems/largest-1-bordered-square/README.md b/problems/largest-1-bordered-square/README.md index 9bce2275a..acb3d3a76 100644 --- a/problems/largest-1-bordered-square/README.md +++ b/problems/largest-1-bordered-square/README.md @@ -36,3 +36,17 @@
  • 1 <= grid[0].length <= 100
  • grid[i][j] is 0 or 1
  • + +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +For each square, know how many ones are up, left, down, and right of this square. You can find it in O(N^2) using dynamic programming. +
    + +
    +Hint 2 +Now for each square ( O(N^3) ), we can evaluate whether that square is 1-bordered in O(1). +
    diff --git a/problems/last-substring-in-lexicographical-order/README.md b/problems/last-substring-in-lexicographical-order/README.md index cff2004a5..799016eab 100644 --- a/problems/last-substring-in-lexicographical-order/README.md +++ b/problems/last-substring-in-lexicographical-order/README.md @@ -35,7 +35,7 @@

    Note:

      -
    1. 1 <= s.length <= 10^5
    2. +
    3. 1 <= s.length <= 4 * 10^5
    4. s contains only lowercase English letters.
    diff --git a/problems/lfu-cache/README.md b/problems/lfu-cache/README.md index 3b5b080ad..d4952eff2 100644 --- a/problems/lfu-cache/README.md +++ b/problems/lfu-cache/README.md @@ -11,18 +11,22 @@ ## [460. LFU Cache (Hard)](https://leetcode.com/problems/lfu-cache "LFU缓存") -

    Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put. -

    +

    Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put.

    -

    -get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
    -put(key, value) - Set or insert the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least frequently used item before inserting a new item. For the purpose of this problem, when there is a tie (i.e., two or more keys that have the same frequency), the least recently used key would be evicted. -

    +

    get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
    +put(key, value) - Set or insert the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least frequently used item before inserting a new item. For the purpose of this problem, when there is a tie (i.e., two or more keys that have the same frequency), the least recently used key would be evicted.

    + +

    Note that the number of times an item is used is the number of calls to the get and put functions for that item since it was inserted. This number is set to zero when the item is removed.

    + +

     

    Follow up:
    Could you do both operations in O(1) time complexity?

    -

    Example: +

     

    + +

    Example:

    +
     LFUCache cache = new LFUCache( 2 /* capacity */ );
     
    @@ -37,7 +41,8 @@ cache.get(1);       // returns -1 (not found)
     cache.get(3);       // returns 3
     cache.get(4);       // returns 4
     
    -

    + +

     

    ### Related Topics [[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] diff --git a/problems/longest-arithmetic-subsequence-of-given-difference/README.md b/problems/longest-arithmetic-subsequence-of-given-difference/README.md index fe73cf40d..d1f167953 100644 --- a/problems/longest-arithmetic-subsequence-of-given-difference/README.md +++ b/problems/longest-arithmetic-subsequence-of-given-difference/README.md @@ -9,9 +9,9 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/path-with-maximum-gold "Path with Maximum Gold") -## [5214. Longest Arithmetic Subsequence of Given Difference (Medium)](https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference "最长定差子序列") +## [1218. Longest Arithmetic Subsequence of Given Difference (Medium)](https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference "最长定差子序列") -

    Given an integer array arr and an integer difference, return the length of the longest arithmetic subsequence in arr such that the difference between adjacent elements in the subsequence equals difference.

    +

    Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference.

     

    Example 1:

    @@ -44,3 +44,23 @@
  • 1 <= arr.length <= 10^5
  • -10^4 <= arr[i], difference <= 10^4
  • + +### Related Topics + [[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Use dynamic programming. +
    + +
    +Hint 2 +Let dp[i] be the maximum length of a subsequence of the given difference whose last element is i. +
    + +
    +Hint 3 +dp[i] = 1 + dp[i-k] +
    diff --git a/problems/longest-chunked-palindrome-decomposition/README.md b/problems/longest-chunked-palindrome-decomposition/README.md index 9503cefe3..2c6b04c05 100644 --- a/problems/longest-chunked-palindrome-decomposition/README.md +++ b/problems/longest-chunked-palindrome-decomposition/README.md @@ -62,3 +62,14 @@ ### Related Topics [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Using a rolling hash, we can quickly check whether two strings are equal. +
    + +
    +Hint 2 +Use that as the basis of a dp. +
    diff --git a/problems/longest-common-subsequence/README.md b/problems/longest-common-subsequence/README.md index 4447b4774..c16b43e6f 100644 --- a/problems/longest-common-subsequence/README.md +++ b/problems/longest-common-subsequence/README.md @@ -53,6 +53,9 @@
  • The input strings consist of lowercase English characters only.
  • +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + ### Hints
    Hint 1 diff --git a/problems/longest-repeating-character-replacement/README.md b/problems/longest-repeating-character-replacement/README.md index 49dfbdf5a..287f5fb0c 100644 --- a/problems/longest-repeating-character-replacement/README.md +++ b/problems/longest-repeating-character-replacement/README.md @@ -11,40 +11,45 @@ ## [424. Longest Repeating Character Replacement (Medium)](https://leetcode.com/problems/longest-repeating-character-replacement "替换后的最长重复字符") -

    Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the length of a longest substring containing all repeating letters you can get after performing the above operations.

    +

    Given a string s that consists of only uppercase English letters, you can perform at most k operations on that string.

    + +

    In one operation, you can choose any character of the string and change it to any other uppercase English character.

    + +

    Find the length of the longest sub-string containing all repeating letters you can get after performing the above operations.

    Note:
    -Both the string's length and k will not exceed 104. -

    +Both the string's length and k will not exceed 104.

    + +

    Example 1:

    -

    -Example 1:

     Input:
    -s = "ABAB", k = 2
    +s = "ABAB", k = 2
     
     Output:
     4
     
     Explanation:
    -Replace the two 'A's with two 'B's or vice versa.
    +Replace the two 'A's with two 'B's or vice versa.
     
    -

    -

    -Example 2: +

     

    + +

    Example 2:

    +
     Input:
    -s = "AABABBA", k = 1
    +s = "AABABBA", k = 1
     
     Output:
     4
     
     Explanation:
    -Replace the one 'A' in the middle with 'B' and form "AABBBBA".
    -The substring "BBBB" has the longest repeating letters, which is 4.
    +Replace the one 'A' in the middle with 'B' and form "AABBBBA".
    +The substring "BBBB" has the longest repeating letters, which is 4.
     
    -

    + +

     

    ### Related Topics [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] diff --git a/problems/longest-well-performing-interval/README.md b/problems/longest-well-performing-interval/README.md index ad598e7c2..7c8cc3af6 100644 --- a/problems/longest-well-performing-interval/README.md +++ b/problems/longest-well-performing-interval/README.md @@ -25,7 +25,8 @@
     Input: hours = [9,9,6,0,6,6,9]
     Output: 3
    -Explanation: The longest well-performing interval is [9,9,6].
    +Explanation: The longest well-performing interval is [9,9,6]. +

     

    Constraints:

    @@ -37,3 +38,14 @@ ### Related Topics [[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] + +### Hints +
    +Hint 1 +Make a new array A of +1/-1s corresponding to if hours[i] is > 8 or not. The goal is to find the longest subarray with positive sum. +
    + +
    +Hint 2 +Using prefix sums (PrefixSum[i+1] = A[0] + A[1] + ... + A[i]), you need to find for each j, the smallest i < j with PrefixSum[i] + 1 == PrefixSum[j]. +
    diff --git a/problems/lowest-common-ancestor-of-deepest-leaves/README.md b/problems/lowest-common-ancestor-of-deepest-leaves/README.md index 4b321a2a6..1b1771fc5 100644 --- a/problems/lowest-common-ancestor-of-deepest-leaves/README.md +++ b/problems/lowest-common-ancestor-of-deepest-leaves/README.md @@ -58,3 +58,19 @@ The answer returned is a TreeNode object (not an array) with serialization " ### Related Topics [[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] + +### Hints +
    +Hint 1 +Do a postorder traversal. +
    + +
    +Hint 2 +Then, if both subtrees contain a deepest leaf, you can mark this node as the answer (so far). +
    + +
    +Hint 3 +The final node marked will be the correct answer. +
    diff --git a/problems/make-array-strictly-increasing/README.md b/problems/make-array-strictly-increasing/README.md index 3bc3acd3e..0bc4f461b 100644 --- a/problems/make-array-strictly-increasing/README.md +++ b/problems/make-array-strictly-increasing/README.md @@ -51,6 +51,9 @@

     

    +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + ### Hints
    Hint 1 diff --git a/problems/maximum-difference-between-node-and-ancestor/README.md b/problems/maximum-difference-between-node-and-ancestor/README.md index ee8151c39..1ef8c0405 100644 --- a/problems/maximum-difference-between-node-and-ancestor/README.md +++ b/problems/maximum-difference-between-node-and-ancestor/README.md @@ -19,7 +19,7 @@

    Example 1:

    -

    +

     Input: [8,3,10,1,6,null,14,null,null,4,7,13]
    diff --git a/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/README.md b/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/README.md
    index 6258c9051..dd2c49d0a 100644
    --- a/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/README.md
    +++ b/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/README.md
    @@ -58,3 +58,7 @@
     
    • 1 <= seq.size <= 10000
    + +### Related Topics + [[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] + [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] diff --git a/problems/maximum-number-of-balloons/README.md b/problems/maximum-number-of-balloons/README.md index 651ef650b..734eca84c 100644 --- a/problems/maximum-number-of-balloons/README.md +++ b/problems/maximum-number-of-balloons/README.md @@ -49,6 +49,10 @@
  • text consists of lower case English letters only.
  • +### Related Topics + [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] + [[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] + ### Hints
    Hint 1 diff --git a/problems/maximum-of-absolute-value-expression/README.md b/problems/maximum-of-absolute-value-expression/README.md index 43165aa08..06e03c1a5 100644 --- a/problems/maximum-of-absolute-value-expression/README.md +++ b/problems/maximum-of-absolute-value-expression/README.md @@ -39,3 +39,13 @@
  • 2 <= arr1.length == arr2.length <= 40000
  • -10^6 <= arr1[i], arr2[i] <= 10^6
  • + +### Related Topics + [[Bit Manipulation](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] + [[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] + +### Hints +
    +Hint 1 +Use the idea that abs(A) + abs(B) = max(A+B, A-B, -A+B, -A-B). +
    diff --git a/problems/maximum-subarray-sum-with-one-deletion/README.md b/problems/maximum-subarray-sum-with-one-deletion/README.md index ef44cc7a1..518b82fb3 100644 --- a/problems/maximum-subarray-sum-with-one-deletion/README.md +++ b/problems/maximum-subarray-sum-with-one-deletion/README.md @@ -47,6 +47,9 @@
  • -10^4 <= arr[i] <= 10^4
  • +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + ### Hints
    Hint 1 diff --git a/problems/minimum-cost-tree-from-leaf-values/README.md b/problems/minimum-cost-tree-from-leaf-values/README.md index 7bf20ddb9..ca8a26009 100644 --- a/problems/minimum-cost-tree-from-leaf-values/README.md +++ b/problems/minimum-cost-tree-from-leaf-values/README.md @@ -45,3 +45,19 @@ There are two possible trees. The first has non-leaf node sum 36, and the secon
  • 1 <= arr[i] <= 15
  • It is guaranteed that the answer fits into a 32-bit signed integer (ie. it is less than 2^31).
  • + +### Related Topics + [[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] + [[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Do a DP, where dp(i, j) is the answer for the subarray arr[i]..arr[j]. +
    + +
    +Hint 2 +For each possible way to partition the subarray i <= k < j, the answer is max(arr[i]..arr[k]) * max(arr[k+1]..arr[j]) + dp(i, k) + dp(k+1, j). +
    diff --git a/problems/minimum-moves-to-reach-target-with-rotations/README.md b/problems/minimum-moves-to-reach-target-with-rotations/README.md index 124b9e918..6ecbdc7b7 100644 --- a/problems/minimum-moves-to-reach-target-with-rotations/README.md +++ b/problems/minimum-moves-to-reach-target-with-rotations/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/queries-quality-and-percentage "Queries Quality and Percentage") -## [5208. Minimum Moves to Reach Target with Rotations (Hard)](https://leetcode.com/problems/minimum-moves-to-reach-target-with-rotations "穿过迷宫的最少移动次数") +## [1210. Minimum Moves to Reach Target with Rotations (Hard)](https://leetcode.com/problems/minimum-moves-to-reach-target-with-rotations "穿过迷宫的最少移动次数")

    In an n*n grid, there is a snake that spans 2 cells and starts moving from the top left corner at (0, 0) and (0, 1). The grid has empty cells represented by zeros and blocked cells represented by ones. The snake wants to reach the lower right corner at (n-1, n-2) and (n-1, n-1).

    @@ -66,6 +66,9 @@
  • It is guaranteed that the snake starts at empty cells.
  • +### Related Topics + [[Breadth-first Search](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] + ### Hints
    Hint 1 diff --git a/problems/n-th-tribonacci-number/README.md b/problems/n-th-tribonacci-number/README.md index d6596b9ea..a6827838c 100644 --- a/problems/n-th-tribonacci-number/README.md +++ b/problems/n-th-tribonacci-number/README.md @@ -43,5 +43,19 @@ T_4 = 1 + 1 + 2 = 4
  • The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.
  • +### Related Topics + [[Recursion](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)] + ### Similar Questions 1. [Climbing Stairs](https://github.com/openset/leetcode/tree/master/problems/climbing-stairs) (Easy) + +### Hints +
    +Hint 1 +Make an array F of length 38, and set F[0] = 0, F[1] = F[2] = 1. +
    + +
    +Hint 2 +Now write a loop where you set F[n+3] = F[n] + F[n+1] + F[n+2], and return F[n]. +
    diff --git a/problems/non-overlapping-intervals/README.md b/problems/non-overlapping-intervals/README.md index e7eef44f5..3c8d9bd33 100644 --- a/problems/non-overlapping-intervals/README.md +++ b/problems/non-overlapping-intervals/README.md @@ -13,11 +13,7 @@

    Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

    -

    Note:

    -
      -
    1. You may assume the interval's end point is always bigger than its start point.
    2. -
    3. Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other.

     

    @@ -25,38 +21,35 @@

    Example 1:

    -Input: [ [1,2], [2,3], [3,4], [1,3] ]
    -
    +Input: [[1,2],[2,3],[3,4],[1,3]]
     Output: 1
    -
     Explanation: [1,3] can be removed and the rest of intervals are non-overlapping.
     
    -

     

    -

    Example 2:

    -Input: [ [1,2], [1,2], [1,2] ]
    -
    +Input: [[1,2],[1,2],[1,2]]
     Output: 2
    -
     Explanation: You need to remove two [1,2] to make the rest of intervals non-overlapping.
     
    -

     

    -

    Example 3:

    -Input: [ [1,2], [2,3] ]
    -
    +Input: [[1,2],[2,3]]
     Output: 0
    -
     Explanation: You don't need to remove any of the intervals since they're already non-overlapping.
     
    -

    NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature.

    +

     

    + +

    Note:

    + +
      +
    1. You may assume the interval's end point is always bigger than its start point.
    2. +
    3. Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other.
    4. +
    ### Related Topics [[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] diff --git a/problems/nth-digit/README.md b/problems/nth-digit/README.md index 541afe836..c608196b6 100644 --- a/problems/nth-digit/README.md +++ b/problems/nth-digit/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/binary-watch "Binary Watch") -## [400. Nth Digit (Easy)](https://leetcode.com/problems/nth-digit "第N个数字") +## [400. Nth Digit (Medium)](https://leetcode.com/problems/nth-digit "第N个数字")

    Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...

    diff --git a/problems/number-of-dice-rolls-with-target-sum/README.md b/problems/number-of-dice-rolls-with-target-sum/README.md index 5ea632094..cab7bd01b 100644 --- a/problems/number-of-dice-rolls-with-target-sum/README.md +++ b/problems/number-of-dice-rolls-with-target-sum/README.md @@ -69,3 +69,12 @@ The answer must be returned modulo 10^9 + 7.
  • 1 <= d, f <= 30
  • 1 <= target <= 1000
  • + +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Use dynamic programming. The states are how many dice are remaining, and what sum total you have rolled so far. +
    diff --git a/problems/number-of-equivalent-domino-pairs/README.md b/problems/number-of-equivalent-domino-pairs/README.md index 86ad7dee4..9f3bf8ac0 100644 --- a/problems/number-of-equivalent-domino-pairs/README.md +++ b/problems/number-of-equivalent-domino-pairs/README.md @@ -27,3 +27,17 @@
  • 1 <= dominoes.length <= 40000
  • 1 <= dominoes[i][j] <= 9
  • + +### Related Topics + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + +### Hints +
    +Hint 1 +For each domino j, find the number of dominoes you've already seen (dominoes i with i < j) that are equivalent. +
    + +
    +Hint 2 +You can keep track of what you've seen using a hashmap. +
    diff --git a/problems/online-majority-element-in-subarray/README.md b/problems/online-majority-element-in-subarray/README.md index 41356eb18..3bafa6159 100644 --- a/problems/online-majority-element-in-subarray/README.md +++ b/problems/online-majority-element-in-subarray/README.md @@ -46,3 +46,34 @@ majorityChecker.query(2,3,2); // returns 2
  • For each query, 2 * threshold > right - left + 1
  • The number of queries is at most 10000
  • + +### Related Topics + [[Segment Tree](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] + +### Hints +
    +Hint 1 +What's special about a majority element ? +
    + +
    +Hint 2 +A majority element appears more than half the length of the array number of times. +
    + +
    +Hint 3 +If we tried a random index of the array, what's the probability that this index has a majority element ? +
    + +
    +Hint 4 +It's more than 50% if that array has a majority element. +
    + +
    +Hint 5 +Try a random index for a proper number of times so that the probability of not finding the answer tends to zero. +
    diff --git a/problems/path-with-maximum-gold/README.md b/problems/path-with-maximum-gold/README.md index c14efd654..1d0dcf23a 100644 --- a/problems/path-with-maximum-gold/README.md +++ b/problems/path-with-maximum-gold/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/count-vowels-permutation "Count Vowels Permutation") -## [5215. Path with Maximum Gold (Medium)](https://leetcode.com/problems/path-with-maximum-gold "黄金矿工") +## [1219. Path with Maximum Gold (Medium)](https://leetcode.com/problems/path-with-maximum-gold "黄金矿工")

    In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty.

    @@ -58,3 +58,12 @@ Path to get the maximum gold, 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7.
  • 0 <= grid[i][j] <= 100
  • There are at most 25 cells containing gold.
  • + +### Related Topics + [[Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] + +### Hints +
    +Hint 1 +Use recursion to try all such paths and find the one with the maximum value. +
    diff --git a/problems/permutation-in-string/README.md b/problems/permutation-in-string/README.md index f87b14787..9ece515a4 100644 --- a/problems/permutation-in-string/README.md +++ b/problems/permutation-in-string/README.md @@ -45,7 +45,7 @@ ### Similar Questions 1. [Minimum Window Substring](https://github.com/openset/leetcode/tree/master/problems/minimum-window-substring) (Hard) - 1. [Find All Anagrams in a String](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) (Easy) + 1. [Find All Anagrams in a String](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) (Medium) ### Hints
    diff --git a/problems/play-with-chips/README.md b/problems/play-with-chips/README.md index 4c513dfaa..1431404cd 100644 --- a/problems/play-with-chips/README.md +++ b/problems/play-with-chips/README.md @@ -9,9 +9,9 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/longest-arithmetic-subsequence-of-given-difference "Longest Arithmetic Subsequence of Given Difference") -## [5213. Play with Chips (Easy)](https://leetcode.com/problems/play-with-chips "玩筹码") +## [1217. Play with Chips (Easy)](https://leetcode.com/problems/play-with-chips "玩筹码") -

    You have the positions of some chips on the number line.

    +

    There are some chips, and the i-th chip is at position chips[i].

    You can perform any of the two following types of moves any number of times (possibly zero) on any chip:

    @@ -48,3 +48,29 @@
  • 1 <= chips.length <= 100
  • 1 <= chips[i] <= 10^9
  • + +### Related Topics + [[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] + [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] + [[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] + +### Hints +
    +Hint 1 +The first move keeps the parity of the element as it is. +
    + +
    +Hint 2 +The second move changes the parity of the element. +
    + +
    +Hint 3 +Since the first move is free, if all the numbers have the same parity, the answer would be zero. +
    + +
    +Hint 4 +Find the minimum cost to make all the numbers have the same parity. +
    diff --git a/problems/print-zero-even-odd/README.md b/problems/print-zero-even-odd/README.md index 6ba8391e3..9654abf57 100644 --- a/problems/print-zero-even-odd/README.md +++ b/problems/print-zero-even-odd/README.md @@ -30,7 +30,7 @@ class ZeroEvenOdd {
  • Thread C will call odd() which should only output odd numbers.
  • -

    Each of the thread is given a printNumber method to output an integer. Modify the given program to output the series 010203040506... where the length of the series must be 2n.

    +

    Each of the threads is given a printNumber method to output an integer. Modify the given program to output the series 010203040506... where the length of the series must be 2n.

     

    diff --git a/problems/queue-reconstruction-by-height/README.md b/problems/queue-reconstruction-by-height/README.md index 089c6b596..c8ac990e3 100644 --- a/problems/queue-reconstruction-by-height/README.md +++ b/problems/queue-reconstruction-by-height/README.md @@ -11,16 +11,14 @@ ## [406. Queue Reconstruction by Height (Medium)](https://leetcode.com/problems/queue-reconstruction-by-height "根据身高重建队列") -

    Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue. -

    +

    Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue.

    Note:
    -The number of people is less than 1,100. -

    +The number of people is less than 1,100.

    +  -
    +

    Example

    -

    Example

     Input:
     [[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]
    @@ -28,7 +26,8 @@ Input:
     Output:
     [[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]]
     
    -

    + +

     

    ### Related Topics [[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] diff --git a/problems/reformat-department-table/README.md b/problems/reformat-department-table/README.md index f5e5b98f7..4ed39a47c 100644 --- a/problems/reformat-department-table/README.md +++ b/problems/reformat-department-table/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/count-substrings-with-only-one-distinct-letter "Count Substrings with Only One Distinct Letter") -## [1179. Reformat Department Table (Easy)](https://leetcode.com/problems/reformat-department-table "") +## [1179. Reformat Department Table (Easy)](https://leetcode.com/problems/reformat-department-table "重新格式化部门表")

    Table: Department

    diff --git a/problems/remove-all-adjacent-duplicates-in-string-ii/README.md b/problems/remove-all-adjacent-duplicates-in-string-ii/README.md index 903f76e1d..1343fa3b9 100644 --- a/problems/remove-all-adjacent-duplicates-in-string-ii/README.md +++ b/problems/remove-all-adjacent-duplicates-in-string-ii/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/minimum-moves-to-reach-target-with-rotations "Minimum Moves to Reach Target with Rotations") -## [5206. Remove All Adjacent Duplicates in String II (Medium)](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii "删除字符串中的所有相邻重复项 II") +## [1209. Remove All Adjacent Duplicates in String II (Medium)](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii "删除字符串中的所有相邻重复项 II")

    Given a string s, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them causing the left and the right side of the deleted substring to concatenate together.

    @@ -53,6 +53,9 @@ Finally delete "ddd", get "aa"
  • s only contains lower case English letters.
  • +### Related Topics + [[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] + ### Hints
    Hint 1 diff --git a/problems/reverse-substrings-between-each-pair-of-parentheses/README.md b/problems/reverse-substrings-between-each-pair-of-parentheses/README.md index f1be89b20..431d61983 100644 --- a/problems/reverse-substrings-between-each-pair-of-parentheses/README.md +++ b/problems/reverse-substrings-between-each-pair-of-parentheses/README.md @@ -11,13 +11,11 @@ ## [1190. Reverse Substrings Between Each Pair of Parentheses (Medium)](https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses "反转每对括号间的子串") -

    Given a string s that consists of lower case English letters and brackets. 

    +

    You are given a string s that consists of lower case English letters and brackets. 

    Reverse the strings in each pair of matching parentheses, starting from the innermost one.

    -

    Your result should not contain any bracket.

    - -

     

    +

    Your result should not contain any brackets.

     

    Example 1:

    @@ -32,6 +30,7 @@
     Input: s = "(u(love)i)"
     Output: "iloveu"
    +Explanation: The substring "love" is reversed first, then the whole string is reversed.
     

    Example 3:

    @@ -39,6 +38,7 @@
     Input: s = "(ed(et(oc))el)"
     Output: "leetcode"
    +Explanation: First, we reverse the substring "oc", then "etco", and finally, the whole string.
     

    Example 4:

    @@ -57,6 +57,9 @@
  • It's guaranteed that all parentheses are balanced.
  • +### Related Topics + [[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] + ### Hints
    Hint 1 diff --git a/problems/robot-bounded-in-circle/README.md b/problems/robot-bounded-in-circle/README.md index 29c9233ab..4a95b7a8e 100644 --- a/problems/robot-bounded-in-circle/README.md +++ b/problems/robot-bounded-in-circle/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/flower-planting-with-no-adjacent "Flower Planting With No Adjacent") -## [1041. Robot Bounded In Circle (Easy)](https://leetcode.com/problems/robot-bounded-in-circle "困于环中的机器人") +## [1041. Robot Bounded In Circle (Medium)](https://leetcode.com/problems/robot-bounded-in-circle "困于环中的机器人")

    On an infinite plane, a robot initially stands at (0, 0) and faces north.  The robot can receive one of three instructions:

    diff --git a/problems/shortest-common-supersequence/README.md b/problems/shortest-common-supersequence/README.md index c206af295..39c7ff71a 100644 --- a/problems/shortest-common-supersequence/README.md +++ b/problems/shortest-common-supersequence/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/statistics-from-a-large-sample "Statistics from a Large Sample") -## [1092. Shortest Common Supersequence (Hard)](https://leetcode.com/problems/shortest-common-supersequence "最短公共超序列") +## [1092. Shortest Common Supersequence (Hard)](https://leetcode.com/problems/shortest-common-supersequence "最短公共超序列")

    Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences.  If multiple answers exist, you may return any of them.

    @@ -23,8 +23,8 @@ Input: str1 = "abac", str2 = "cab" Output: "cabac" Explanation: -str1 = "abac" is a substring of "cabac" because we can delete the first "c". -str2 = "cab" is a substring of "cabac" because we can delete the last "ac". +str1 = "abac" is a subsequence of "cabac" because we can delete the first "c". +str2 = "cab" is a subsequence of "cabac" because we can delete the last "ac". The answer provided is the shortest such string that satisfies these properties. diff --git a/problems/shortest-path-in-binary-matrix/README.md b/problems/shortest-path-in-binary-matrix/README.md index f088a2f79..3e805ecb2 100644 --- a/problems/shortest-path-in-binary-matrix/README.md +++ b/problems/shortest-path-in-binary-matrix/README.md @@ -29,16 +29,23 @@

    Example 1:

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

    Example 2:

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

     

    diff --git a/problems/shortest-path-with-alternating-colors/README.md b/problems/shortest-path-with-alternating-colors/README.md index 208b7d679..3c5da4d1a 100644 --- a/problems/shortest-path-with-alternating-colors/README.md +++ b/problems/shortest-path-with-alternating-colors/README.md @@ -44,3 +44,13 @@
  • red_edges[i].length == blue_edges[i].length == 2
  • 0 <= red_edges[i][j], blue_edges[i][j] < n
  • + +### Related Topics + [[Breadth-first Search](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] + [[Graph](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] + +### Hints +
    +Hint 1 +Do a breadth-first search, where the "nodes" are actually (Node, color of last edge taken). +
    diff --git a/problems/single-element-in-a-sorted-array/README.md b/problems/single-element-in-a-sorted-array/README.md index 87855cd0e..4fb75deb3 100644 --- a/problems/single-element-in-a-sorted-array/README.md +++ b/problems/single-element-in-a-sorted-array/README.md @@ -11,7 +11,7 @@ ## [540. Single Element in a Sorted Array (Medium)](https://leetcode.com/problems/single-element-in-a-sorted-array "有序数组中的单一元素") -

    Given a sorted array consisting of only integers where every element appears exactly twice except for one element which appears exactly once. Find this single element that appears only once.

    +

    You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Find this single element that appears only once.

     

    diff --git a/problems/smallest-range-covering-elements-from-k-lists/README.md b/problems/smallest-range-covering-elements-from-k-lists/README.md index 1f4f9bbf5..b620a8a3f 100644 --- a/problems/smallest-range-covering-elements-from-k-lists/README.md +++ b/problems/smallest-range-covering-elements-from-k-lists/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/sum-of-square-numbers "Sum of Square Numbers") -## [632. Smallest Range Covering Elements from K Lists (Hard)](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists "") +## [632. Smallest Range Covering Elements from K Lists (Hard)](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists "最小区间")

    You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists.

    @@ -42,6 +42,3 @@ List 3: [5, 18, 22, 30], 22 is in range [20,24]. [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] - -### Similar Questions - 1. [Minimum Window Substring](https://github.com/openset/leetcode/tree/master/problems/minimum-window-substring) (Hard) diff --git a/problems/smallest-sufficient-team/README.md b/problems/smallest-sufficient-team/README.md index 46140f9b5..3b640da43 100644 --- a/problems/smallest-sufficient-team/README.md +++ b/problems/smallest-sufficient-team/README.md @@ -36,9 +36,21 @@
  • 1 <= people[i].length, req_skills[i].length, people[i][j].length <= 16
  • Elements of req_skills and people[i] are (respectively) distinct.
  • req_skills[i][j], people[i][j][k] are lowercase English letters.
  • +
  • Every skill in people[i] is a skill in req_skills.
  • It is guaranteed a sufficient team exists.
  • ### Related Topics [[Bit Manipulation](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Do a bitmask DP. +
    + +
    +Hint 2 +For each person, for each set of skills, we can update our understanding of a minimum set of people needed to perform this set of skills. +
    diff --git a/problems/split-array-into-consecutive-subsequences/README.md b/problems/split-array-into-consecutive-subsequences/README.md index 287faba86..2289bdc9e 100644 --- a/problems/split-array-into-consecutive-subsequences/README.md +++ b/problems/split-array-into-consecutive-subsequences/README.md @@ -11,9 +11,12 @@ ## [659. Split Array into Consecutive Subsequences (Medium)](https://leetcode.com/problems/split-array-into-consecutive-subsequences "分割数组为连续子序列") -

    You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subsequences consist of at least 3 consecutive integers. Return whether you can make such a split.

    +

    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.

    + +

     

    + +

    Example 1:

    -

    Example 1:

     Input: [1,2,3,3,4,5]
     Output: True
    @@ -21,10 +24,11 @@
     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
    @@ -32,21 +36,25 @@ You can split them into two consecutive subsequences :
     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
     
    -

    -

    Note:
    -

      -
    1. The length of the input is in range of [1, 10000]
    2. -
    -

    +

     

    + +

    Constraints:

    + +
      +
    • 1 <= nums.length <= 10000
    • +
    + +

     

    ### Related Topics [[Heap](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] diff --git a/problems/stepping-numbers/README.md b/problems/stepping-numbers/README.md index ca326c32b..e8bdd8bd6 100644 --- a/problems/stepping-numbers/README.md +++ b/problems/stepping-numbers/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome-iii "Valid Palindrome III") -## [5081. Stepping Numbers (Medium)](https://leetcode.com/problems/stepping-numbers "步进数") +## [1215. Stepping Numbers (Medium)](https://leetcode.com/problems/stepping-numbers "步进数")

    A Stepping Number is an integer such that all of its adjacent digits have an absolute difference of exactly 1. For example, 321 is a Stepping Number while 421 is not.

    diff --git a/problems/stone-game-ii/README.md b/problems/stone-game-ii/README.md index e4852a44c..248756506 100644 --- a/problems/stone-game-ii/README.md +++ b/problems/stone-game-ii/README.md @@ -37,3 +37,12 @@
  • 1 <= piles.length <= 100
  • 1 <= piles[i] <= 10 ^ 4
  • + +### Related Topics + [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] + +### Hints +
    +Hint 1 +Use dynamic programming: the states are (i, m) for the answer of piles[i:] and that given m. +
    diff --git a/problems/swap-for-longest-repeated-character-substring/README.md b/problems/swap-for-longest-repeated-character-substring/README.md index 5cb9095db..f128f05f7 100644 --- a/problems/swap-for-longest-repeated-character-substring/README.md +++ b/problems/swap-for-longest-repeated-character-substring/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/online-majority-element-in-subarray "Online Majority Element In Subarray") -## [1156. Swap For Longest Repeated Character Substring (Medium)](https://leetcode.com/problems/swap-for-longest-repeated-character-substring "") +## [1156. Swap For Longest Repeated Character Substring (Medium)](https://leetcode.com/problems/swap-for-longest-repeated-character-substring "单字符重复子串的最大长度")

    Given a string text, we are allowed to swap two of the characters in the string. Find the length of the longest substring with repeated characters.

    diff --git a/problems/two-sum-bsts/README.md b/problems/two-sum-bsts/README.md index 790a334ba..293ac5d8c 100644 --- a/problems/two-sum-bsts/README.md +++ b/problems/two-sum-bsts/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/stepping-numbers "Stepping Numbers") -## [5080. Two Sum BSTs (Medium)](https://leetcode.com/problems/two-sum-bsts "查找两棵二叉搜索树之和") +## [1214. Two Sum BSTs (Medium)](https://leetcode.com/problems/two-sum-bsts "查找两棵二叉搜索树之和")

    Given two binary search trees, return True if and only if there is a node in the first tree and a node in the second tree whose values sum up to a given integer target.

    diff --git a/problems/unique-number-of-occurrences/README.md b/problems/unique-number-of-occurrences/README.md index b24ff3f12..0483c827b 100644 --- a/problems/unique-number-of-occurrences/README.md +++ b/problems/unique-number-of-occurrences/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/get-equal-substrings-within-budget "Get Equal Substrings Within Budget") -## [5205. Unique Number of Occurrences (Easy)](https://leetcode.com/problems/unique-number-of-occurrences "独一无二的出现次数") +## [1207. Unique Number of Occurrences (Easy)](https://leetcode.com/problems/unique-number-of-occurrences "独一无二的出现次数")

    Given an array of integers arr, write a function that returns true if and only if the number of occurrences of each value in the array is unique.

    @@ -43,6 +43,9 @@
  • -1000 <= arr[i] <= 1000
  • +### Related Topics + [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] + ### Hints
    Hint 1 diff --git a/problems/valid-palindrome-iii/README.md b/problems/valid-palindrome-iii/README.md index d92692a8d..179cb388f 100644 --- a/problems/valid-palindrome-iii/README.md +++ b/problems/valid-palindrome-iii/README.md @@ -9,7 +9,7 @@                  [Next >](https://github.com/openset/leetcode/tree/master/problems/play-with-chips "Play with Chips") -## [5099. Valid Palindrome III (Hard)](https://leetcode.com/problems/valid-palindrome-iii "验证回文字符串 III") +## [1216. Valid Palindrome III (Hard)](https://leetcode.com/problems/valid-palindrome-iii "验证回文字符串 III")

    Given a string s and an integer k, find out if the given string is a K-Palindrome or not.

    diff --git a/tag/array/README.md b/tag/array/README.md index 3da9efd90..f362a8734 100644 --- a/tag/array/README.md +++ b/tag/array/README.md @@ -9,18 +9,25 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1217 | [玩筹码](https://github.com/openset/leetcode/tree/master/problems/play-with-chips) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | +| 1208 | [尽可能使字符串相等](https://github.com/openset/leetcode/tree/master/problems/get-equal-substrings-within-budget) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | +| 1185 | [一周中的第几天](https://github.com/openset/leetcode/tree/master/problems/day-of-the-week) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | +| 1184 | [公交站间的距离](https://github.com/openset/leetcode/tree/master/problems/distance-between-bus-stops) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | | 1177 | [构建回文串检测](https://github.com/openset/leetcode/tree/master/problems/can-make-palindrome-from-substring) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | -| 1176 | [健身计划评估](https://github.com/openset/leetcode/tree/master/problems/diet-plan-performance) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Easy | +| 1176 | [健身计划评估](https://github.com/openset/leetcode/tree/master/problems/diet-plan-performance) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Easy | | 1170 | [比较字符串最小字母出现频次](https://github.com/openset/leetcode/tree/master/problems/compare-strings-by-frequency-of-the-smallest-character) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | -| 1169 | [查询无效交易](https://github.com/openset/leetcode/tree/master/problems/invalid-transactions) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | +| 1169 | [查询无效交易](https://github.com/openset/leetcode/tree/master/problems/invalid-transactions) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1160 | [拼写单词](https://github.com/openset/leetcode/tree/master/problems/find-words-that-can-be-formed-by-characters) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | +| 1157 | [子数组中占绝大多数的元素](https://github.com/openset/leetcode/tree/master/problems/online-majority-element-in-subarray) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Hard | | 1152 | [用户网站访问行为分析](https://github.com/openset/leetcode/tree/master/problems/analyze-user-website-visit-pattern) 🔒 | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 1151 | [最少交换次数来组合所有的 1](https://github.com/openset/leetcode/tree/master/problems/minimum-swaps-to-group-all-1s-together) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 1150 | [检查一个数是否在数组中占绝大多数](https://github.com/openset/leetcode/tree/master/problems/check-if-a-number-is-majority-element-in-a-sorted-array) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | | 1146 | [快照数组](https://github.com/openset/leetcode/tree/master/problems/snapshot-array) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Medium | | 1144 | [递减元素使数组呈锯齿状](https://github.com/openset/leetcode/tree/master/problems/decrease-elements-to-make-array-zigzag) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Medium | | 1133 | [最大唯一数](https://github.com/openset/leetcode/tree/master/problems/largest-unique-number) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | +| 1128 | [等价多米诺骨牌对的数量](https://github.com/openset/leetcode/tree/master/problems/number-of-equivalent-domino-pairs) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | | 1122 | [数组的相对排序](https://github.com/openset/leetcode/tree/master/problems/relative-sort-array) | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | +| 1109 | [航班预订统计](https://github.com/openset/leetcode/tree/master/problems/corporate-flight-bookings) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1099 | [小于 K 的两数之和](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | | 1089 | [复写零](https://github.com/openset/leetcode/tree/master/problems/duplicate-zeros) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | | 1086 | [前五科的均分](https://github.com/openset/leetcode/tree/master/problems/high-five) 🔒 | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | diff --git a/tag/backtracking/README.md b/tag/backtracking/README.md index f38689c12..6595ae7ac 100644 --- a/tag/backtracking/README.md +++ b/tag/backtracking/README.md @@ -9,7 +9,8 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5081 | [步进数](https://github.com/openset/leetcode/tree/master/problems/stepping-numbers) | [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | +| 1219 | [黄金矿工](https://github.com/openset/leetcode/tree/master/problems/path-with-maximum-gold) | [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | +| 1215 | [步进数](https://github.com/openset/leetcode/tree/master/problems/stepping-numbers) 🔒 | [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | | 1088 | [易混淆数 II](https://github.com/openset/leetcode/tree/master/problems/confusing-number-ii) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Hard | | 1087 | [字母切换](https://github.com/openset/leetcode/tree/master/problems/brace-expansion) 🔒 | [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | | 1079 | [活字印刷](https://github.com/openset/leetcode/tree/master/problems/letter-tile-possibilities) | [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | diff --git a/tag/binary-search-tree/README.md b/tag/binary-search-tree/README.md index c436f8c02..5a01d10b4 100644 --- a/tag/binary-search-tree/README.md +++ b/tag/binary-search-tree/README.md @@ -9,5 +9,5 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5080 | [查找两棵二叉搜索树之和](https://github.com/openset/leetcode/tree/master/problems/two-sum-bsts) | [[二叉搜索树](https://github.com/openset/leetcode/tree/master/tag/binary-search-tree/README.md)] | Medium | +| 1214 | [查找两棵二叉搜索树之和](https://github.com/openset/leetcode/tree/master/problems/two-sum-bsts) 🔒 | [[二叉搜索树](https://github.com/openset/leetcode/tree/master/tag/binary-search-tree/README.md)] | Medium | | 1038 | [从二叉搜索树到更大和树](https://github.com/openset/leetcode/tree/master/problems/binary-search-tree-to-greater-sum-tree) | [[二叉搜索树](https://github.com/openset/leetcode/tree/master/tag/binary-search-tree/README.md)] | Medium | diff --git a/tag/binary-search/README.md b/tag/binary-search/README.md index 317fe94be..fcc66534b 100644 --- a/tag/binary-search/README.md +++ b/tag/binary-search/README.md @@ -10,7 +10,9 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | | 1182 | [与目标颜色间的最短距离](https://github.com/openset/leetcode/tree/master/problems/shortest-distance-to-target-color) 🔒 | [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | +| 1157 | [子数组中占绝大多数的元素](https://github.com/openset/leetcode/tree/master/problems/online-majority-element-in-subarray) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Hard | | 1150 | [检查一个数是否在数组中占绝大多数](https://github.com/openset/leetcode/tree/master/problems/check-if-a-number-is-majority-element-in-a-sorted-array) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | +| 1111 | [有效括号的嵌套深度](https://github.com/openset/leetcode/tree/master/problems/maximum-nesting-depth-of-two-valid-parentheses-strings) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | | 1095 | [山脉数组中查找目标值](https://github.com/openset/leetcode/tree/master/problems/find-in-mountain-array) | [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Hard | | 1064 | [不动点](https://github.com/openset/leetcode/tree/master/problems/fixed-point) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | | 1060 | [有序数组中的缺失元素](https://github.com/openset/leetcode/tree/master/problems/missing-element-in-sorted-array) 🔒 | [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | diff --git a/tag/bit-manipulation/README.md b/tag/bit-manipulation/README.md index fb9234acd..31f102e0d 100644 --- a/tag/bit-manipulation/README.md +++ b/tag/bit-manipulation/README.md @@ -10,6 +10,7 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | | 1178 | [猜字谜](https://github.com/openset/leetcode/tree/master/problems/number-of-valid-words-for-each-puzzle) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Hard | +| 1131 | [绝对值表达式的最大值](https://github.com/openset/leetcode/tree/master/problems/maximum-of-absolute-value-expression) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1125 | [最小的必要团队](https://github.com/openset/leetcode/tree/master/problems/smallest-sufficient-team) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | | 898 | [子数组按位或操作](https://github.com/openset/leetcode/tree/master/problems/bitwise-ors-of-subarrays) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 784 | [字母大小写全排列](https://github.com/openset/leetcode/tree/master/problems/letter-case-permutation) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Easy | diff --git a/tag/breadth-first-search/README.md b/tag/breadth-first-search/README.md index 6ac31a944..3fc5a2bf3 100644 --- a/tag/breadth-first-search/README.md +++ b/tag/breadth-first-search/README.md @@ -9,7 +9,9 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1210 | [穿过迷宫的最少移动次数](https://github.com/openset/leetcode/tree/master/problems/minimum-moves-to-reach-target-with-rotations) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] | Hard | | 1162 | [地图分析](https://github.com/openset/leetcode/tree/master/problems/as-far-from-land-as-possible) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | +| 1129 | [颜色交替的最短路径](https://github.com/openset/leetcode/tree/master/problems/shortest-path-with-alternating-colors) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | | 1091 | [二进制矩阵中的最短路径](https://github.com/openset/leetcode/tree/master/problems/shortest-path-in-binary-matrix) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] | Medium | | 1036 | [逃离大迷宫](https://github.com/openset/leetcode/tree/master/problems/escape-a-large-maze) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] | Hard | | 994 | [腐烂的橘子](https://github.com/openset/leetcode/tree/master/problems/rotting-oranges) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] | Easy | diff --git a/tag/depth-first-search/README.md b/tag/depth-first-search/README.md index f3f0fd131..f7723b38a 100644 --- a/tag/depth-first-search/README.md +++ b/tag/depth-first-search/README.md @@ -9,9 +9,11 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1192 | [查找集群内的「关键连接」](https://github.com/openset/leetcode/tree/master/problems/critical-connections-in-a-network) | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Hard | | 1145 | [二叉树着色游戏](https://github.com/openset/leetcode/tree/master/problems/binary-tree-coloring-game) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | | 1136 | [平行课程](https://github.com/openset/leetcode/tree/master/problems/parallel-courses) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | | 1123 | [最深叶节点的最近公共祖先](https://github.com/openset/leetcode/tree/master/problems/lowest-common-ancestor-of-deepest-leaves) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | +| 1110 | [删点成林](https://github.com/openset/leetcode/tree/master/problems/delete-nodes-and-return-forest) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | | 1102 | [得分最高的路径](https://github.com/openset/leetcode/tree/master/problems/path-with-maximum-minimum-value) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[并查集](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | | 1080 | [根到叶路径上的不足节点](https://github.com/openset/leetcode/tree/master/problems/insufficient-nodes-in-root-to-leaf-paths) | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | | 1061 | [按字典序排列最小的等效字符串](https://github.com/openset/leetcode/tree/master/problems/lexicographically-smallest-equivalent-string) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[并查集](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)] | Medium | diff --git a/tag/design/README.md b/tag/design/README.md index 51c8dff19..b2b607984 100644 --- a/tag/design/README.md +++ b/tag/design/README.md @@ -9,6 +9,7 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1206 | [设计跳表](https://github.com/openset/leetcode/tree/master/problems/design-skiplist) | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] | Hard | | 1172 | [餐盘栈](https://github.com/openset/leetcode/tree/master/problems/dinner-plate-stacks) | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] | Hard | | 1166 | [设计文件系统](https://github.com/openset/leetcode/tree/master/problems/design-file-system) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 716 | [最大栈](https://github.com/openset/leetcode/tree/master/problems/max-stack) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] | Easy | diff --git a/tag/dynamic-programming/README.md b/tag/dynamic-programming/README.md index 8859a0d98..df0e7c825 100644 --- a/tag/dynamic-programming/README.md +++ b/tag/dynamic-programming/README.md @@ -9,9 +9,19 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5099 | [验证回文字符串 III](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome-iii) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1220 | [统计元音字母序列的数目](https://github.com/openset/leetcode/tree/master/problems/count-vowels-permutation) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1218 | [最长定差子序列](https://github.com/openset/leetcode/tree/master/problems/longest-arithmetic-subsequence-of-given-difference) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1216 | [验证回文字符串 III](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome-iii) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1191 | [K 次串联后最大子数组之和](https://github.com/openset/leetcode/tree/master/problems/k-concatenation-maximum-sum) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1187 | [使数组严格递增](https://github.com/openset/leetcode/tree/master/problems/make-array-strictly-increasing) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1186 | [删除一次得到子数组最大和](https://github.com/openset/leetcode/tree/master/problems/maximum-subarray-sum-with-one-deletion) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1155 | [掷骰子的N种方法](https://github.com/openset/leetcode/tree/master/problems/number-of-dice-rolls-with-target-sum) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1147 | [段式回文](https://github.com/openset/leetcode/tree/master/problems/longest-chunked-palindrome-decomposition) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1143 | [最长公共子序列](https://github.com/openset/leetcode/tree/master/problems/longest-common-subsequence) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1140 | [石子游戏 II](https://github.com/openset/leetcode/tree/master/problems/stone-game-ii) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1139 | [最大的以 1 为边界的正方形](https://github.com/openset/leetcode/tree/master/problems/largest-1-bordered-square) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1136 | [平行课程](https://github.com/openset/leetcode/tree/master/problems/parallel-courses) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1130 | [叶值的最小代价生成树](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-tree-from-leaf-values) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1125 | [最小的必要团队](https://github.com/openset/leetcode/tree/master/problems/smallest-sufficient-team) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | | 1105 | [填充书架](https://github.com/openset/leetcode/tree/master/problems/filling-bookcase-shelves) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1092 | [最短公共超序列](https://github.com/openset/leetcode/tree/master/problems/shortest-common-supersequence) | [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | diff --git a/tag/graph/README.md b/tag/graph/README.md index 647c932d2..7dbae34b8 100644 --- a/tag/graph/README.md +++ b/tag/graph/README.md @@ -15,6 +15,7 @@ | 1153 | [字符串转化](https://github.com/openset/leetcode/tree/master/problems/string-transforms-into-another-string) 🔒 | [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Hard | | 1136 | [平行课程](https://github.com/openset/leetcode/tree/master/problems/parallel-courses) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | | 1135 | [最低成本联通所有城市](https://github.com/openset/leetcode/tree/master/problems/connecting-cities-with-minimum-cost) 🔒 | [[并查集](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | +| 1129 | [颜色交替的最短路径](https://github.com/openset/leetcode/tree/master/problems/shortest-path-with-alternating-colors) | [[广度优先搜索](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | | 1102 | [得分最高的路径](https://github.com/openset/leetcode/tree/master/problems/path-with-maximum-minimum-value) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[并查集](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | | 1059 | [从始点到终点的所有路径](https://github.com/openset/leetcode/tree/master/problems/all-paths-from-source-lead-to-destination) 🔒 | [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | | 1043 | [分隔数组以得到最大和](https://github.com/openset/leetcode/tree/master/problems/partition-array-for-maximum-sum) | [[图](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] | Medium | diff --git a/tag/greedy/README.md b/tag/greedy/README.md index 8e4d48102..6318d3024 100644 --- a/tag/greedy/README.md +++ b/tag/greedy/README.md @@ -9,7 +9,9 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1217 | [玩筹码](https://github.com/openset/leetcode/tree/master/problems/play-with-chips) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | | 1167 | [连接棒材的最低费用](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-to-connect-sticks) 🔒 | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] | Medium | +| 1111 | [有效括号的嵌套深度](https://github.com/openset/leetcode/tree/master/problems/maximum-nesting-depth-of-two-valid-parentheses-strings) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | | 1094 | [拼车](https://github.com/openset/leetcode/tree/master/problems/car-pooling) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] | Medium | | 1090 | [受标签影响的最大值](https://github.com/openset/leetcode/tree/master/problems/largest-values-from-labels) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 1058 | [最小化舍入误差以满足目标](https://github.com/openset/leetcode/tree/master/problems/minimize-rounding-error-to-meet-target) 🔒 | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | diff --git a/tag/hash-table/README.md b/tag/hash-table/README.md index 064cdbd60..32a2263c8 100644 --- a/tag/hash-table/README.md +++ b/tag/hash-table/README.md @@ -9,11 +9,14 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5079 | [三个有序数组的交集](https://github.com/openset/leetcode/tree/master/problems/intersection-of-three-sorted-arrays) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | +| 1213 | [三个有序数组的交集](https://github.com/openset/leetcode/tree/master/problems/intersection-of-three-sorted-arrays) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | +| 1207 | [独一无二的出现次数](https://github.com/openset/leetcode/tree/master/problems/unique-number-of-occurrences) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | +| 1189 | [“气球” 的最大数量](https://github.com/openset/leetcode/tree/master/problems/maximum-number-of-balloons) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1178 | [猜字谜](https://github.com/openset/leetcode/tree/master/problems/number-of-valid-words-for-each-puzzle) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Hard | | 1166 | [设计文件系统](https://github.com/openset/leetcode/tree/master/problems/design-file-system) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 1160 | [拼写单词](https://github.com/openset/leetcode/tree/master/problems/find-words-that-can-be-formed-by-characters) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 1152 | [用户网站访问行为分析](https://github.com/openset/leetcode/tree/master/problems/analyze-user-website-visit-pattern) 🔒 | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | +| 1138 | [字母板上的路径](https://github.com/openset/leetcode/tree/master/problems/alphabet-board-path) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1133 | [最大唯一数](https://github.com/openset/leetcode/tree/master/problems/largest-unique-number) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 1090 | [受标签影响的最大值](https://github.com/openset/leetcode/tree/master/problems/largest-values-from-labels) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 1086 | [前五科的均分](https://github.com/openset/leetcode/tree/master/problems/high-five) 🔒 | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | @@ -58,7 +61,7 @@ | 676 | [实现一个魔法字典](https://github.com/openset/leetcode/tree/master/problems/implement-magic-dictionary) | [[字典树](https://github.com/openset/leetcode/tree/master/tag/trie/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 648 | [单词替换](https://github.com/openset/leetcode/tree/master/problems/replace-words) | [[字典树](https://github.com/openset/leetcode/tree/master/tag/trie/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 645 | [错误的集合](https://github.com/openset/leetcode/tree/master/problems/set-mismatch) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | -| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | +| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | | 624 | [数组列表中的最大距离](https://github.com/openset/leetcode/tree/master/problems/maximum-distance-in-arrays) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 609 | [在系统中查找重复文件](https://github.com/openset/leetcode/tree/master/problems/find-duplicate-file-in-system) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 599 | [两个列表的最小索引总和](https://github.com/openset/leetcode/tree/master/problems/minimum-index-sum-of-two-lists) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | @@ -74,7 +77,7 @@ | 454 | [四数相加 II](https://github.com/openset/leetcode/tree/master/problems/4sum-ii) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | | 451 | [根据字符出现频率排序](https://github.com/openset/leetcode/tree/master/problems/sort-characters-by-frequency) | [[堆](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 447 | [回旋镖的数量](https://github.com/openset/leetcode/tree/master/problems/number-of-boomerangs) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | -| 438 | [找到字符串中所有字母异位词](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | +| 438 | [找到字符串中所有字母异位词](https://github.com/openset/leetcode/tree/master/problems/find-all-anagrams-in-a-string) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 409 | [最长回文串](https://github.com/openset/leetcode/tree/master/problems/longest-palindrome) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 389 | [找不同](https://github.com/openset/leetcode/tree/master/problems/find-the-difference) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 387 | [字符串中的第一个唯一字符](https://github.com/openset/leetcode/tree/master/problems/first-unique-character-in-a-string) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | @@ -92,7 +95,7 @@ | 325 | [和等于 k 的最长子数组长度](https://github.com/openset/leetcode/tree/master/problems/maximum-size-subarray-sum-equals-k) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 314 | [二叉树的垂直遍历](https://github.com/openset/leetcode/tree/master/problems/binary-tree-vertical-order-traversal) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 311 | [稀疏矩阵的乘法](https://github.com/openset/leetcode/tree/master/problems/sparse-matrix-multiplication) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | -| 299 | [猜数字游戏](https://github.com/openset/leetcode/tree/master/problems/bulls-and-cows) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | +| 299 | [猜数字游戏](https://github.com/openset/leetcode/tree/master/problems/bulls-and-cows) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 290 | [单词规律](https://github.com/openset/leetcode/tree/master/problems/word-pattern) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 288 | [单词的唯一缩写](https://github.com/openset/leetcode/tree/master/problems/unique-word-abbreviation) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 274 | [H指数](https://github.com/openset/leetcode/tree/master/problems/h-index) | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | diff --git a/tag/math/README.md b/tag/math/README.md index 5149961f7..4c3b0aa90 100644 --- a/tag/math/README.md +++ b/tag/math/README.md @@ -9,11 +9,16 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1218 | [最长定差子序列](https://github.com/openset/leetcode/tree/master/problems/longest-arithmetic-subsequence-of-given-difference) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | +| 1217 | [玩筹码](https://github.com/openset/leetcode/tree/master/problems/play-with-chips) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | | 1183 | [矩阵中 1 的最大数量](https://github.com/openset/leetcode/tree/master/problems/maximum-number-of-ones) 🔒 | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Hard | | 1180 | [统计只含单一字母的子串](https://github.com/openset/leetcode/tree/master/problems/count-substrings-with-only-one-distinct-letter) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1175 | [质数排列](https://github.com/openset/leetcode/tree/master/problems/prime-arrangements) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | +| 1154 | [一年中的第几天](https://github.com/openset/leetcode/tree/master/problems/day-of-the-year) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | | 1134 | [阿姆斯特朗数](https://github.com/openset/leetcode/tree/master/problems/armstrong-number) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | +| 1131 | [绝对值表达式的最大值](https://github.com/openset/leetcode/tree/master/problems/maximum-of-absolute-value-expression) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1121 | [将数组分成几个递增序列](https://github.com/openset/leetcode/tree/master/problems/divide-array-into-increasing-sequences) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Hard | +| 1109 | [航班预订统计](https://github.com/openset/leetcode/tree/master/problems/corporate-flight-bookings) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1104 | [二叉树寻路](https://github.com/openset/leetcode/tree/master/problems/path-in-zigzag-labelled-binary-tree) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1103 | [分糖果 II](https://github.com/openset/leetcode/tree/master/problems/distribute-candies-to-people) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | | 1093 | [大样本统计](https://github.com/openset/leetcode/tree/master/problems/statistics-from-a-large-sample) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | @@ -22,7 +27,7 @@ | 1067 | [范围内的数字计数](https://github.com/openset/leetcode/tree/master/problems/digit-count-in-range) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | | 1058 | [最小化舍入误差以满足目标](https://github.com/openset/leetcode/tree/master/problems/minimize-rounding-error-to-meet-target) 🔒 | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1056 | [易混淆数](https://github.com/openset/leetcode/tree/master/problems/confusing-number) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | -| 1041 | [困于环中的机器人](https://github.com/openset/leetcode/tree/master/problems/robot-bounded-in-circle) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | +| 1041 | [困于环中的机器人](https://github.com/openset/leetcode/tree/master/problems/robot-bounded-in-circle) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1037 | [有效的回旋镖](https://github.com/openset/leetcode/tree/master/problems/valid-boomerang) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | | 1025 | [除数博弈](https://github.com/openset/leetcode/tree/master/problems/divisor-game) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Easy | | 1017 | [负二进制转换](https://github.com/openset/leetcode/tree/master/problems/convert-to-base-2) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | @@ -102,7 +107,7 @@ | 441 | [排列硬币](https://github.com/openset/leetcode/tree/master/problems/arranging-coins) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | | 423 | [从英文中重建数字](https://github.com/openset/leetcode/tree/master/problems/reconstruct-original-digits-from-english) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 413 | [等差数列划分](https://github.com/openset/leetcode/tree/master/problems/arithmetic-slices) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | -| 400 | [第N个数字](https://github.com/openset/leetcode/tree/master/problems/nth-digit) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Easy | +| 400 | [第N个数字](https://github.com/openset/leetcode/tree/master/problems/nth-digit) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 397 | [整数替换](https://github.com/openset/leetcode/tree/master/problems/integer-replacement) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 396 | [旋转函数](https://github.com/openset/leetcode/tree/master/problems/rotate-function) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 372 | [超级次方](https://github.com/openset/leetcode/tree/master/problems/super-pow) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | diff --git a/tag/recursion/README.md b/tag/recursion/README.md index 4da7899c1..8e30e1029 100644 --- a/tag/recursion/README.md +++ b/tag/recursion/README.md @@ -9,6 +9,7 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1137 | [第 N 个泰波那契数](https://github.com/openset/leetcode/tree/master/problems/n-th-tribonacci-number) | [[递归](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)] | Easy | | 938 | [二叉搜索树的范围和](https://github.com/openset/leetcode/tree/master/problems/range-sum-of-bst) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[递归](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)] | Easy | | 894 | [所有可能的满二叉树](https://github.com/openset/leetcode/tree/master/problems/all-possible-full-binary-trees) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[递归](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)] | Medium | | 794 | [有效的井字游戏](https://github.com/openset/leetcode/tree/master/problems/valid-tic-tac-toe-state) | [[递归](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | diff --git a/tag/segment-tree/README.md b/tag/segment-tree/README.md index 6138f960a..600969c34 100644 --- a/tag/segment-tree/README.md +++ b/tag/segment-tree/README.md @@ -9,6 +9,7 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1157 | [子数组中占绝大多数的元素](https://github.com/openset/leetcode/tree/master/problems/online-majority-element-in-subarray) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Hard | | 850 | [矩形面积 II](https://github.com/openset/leetcode/tree/master/problems/rectangle-area-ii) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[Line Sweep](https://github.com/openset/leetcode/tree/master/tag/line-sweep/README.md)] | Hard | | 732 | [我的日程安排表 III](https://github.com/openset/leetcode/tree/master/problems/my-calendar-iii) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[Ordered Map](https://github.com/openset/leetcode/tree/master/tag/ordered-map/README.md)] | Hard | | 715 | [Range 模块](https://github.com/openset/leetcode/tree/master/problems/range-module) | [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[Ordered Map](https://github.com/openset/leetcode/tree/master/tag/ordered-map/README.md)] | Hard | diff --git a/tag/sliding-window/README.md b/tag/sliding-window/README.md index 84dfa21e3..ce776e7b0 100644 --- a/tag/sliding-window/README.md +++ b/tag/sliding-window/README.md @@ -9,7 +9,8 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 1176 | [健身计划评估](https://github.com/openset/leetcode/tree/master/problems/diet-plan-performance) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Easy | +| 1208 | [尽可能使字符串相等](https://github.com/openset/leetcode/tree/master/problems/get-equal-substrings-within-budget) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | +| 1176 | [健身计划评估](https://github.com/openset/leetcode/tree/master/problems/diet-plan-performance) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Easy | | 1151 | [最少交换次数来组合所有的 1](https://github.com/openset/leetcode/tree/master/problems/minimum-swaps-to-group-all-1s-together) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 1100 | [长度为 K 的无重复字符子串](https://github.com/openset/leetcode/tree/master/problems/find-k-length-substrings-with-no-repeated-characters) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 1074 | [元素和为目标值的子矩阵数量](https://github.com/openset/leetcode/tree/master/problems/number-of-submatrices-that-sum-to-target) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | diff --git a/tag/stack/README.md b/tag/stack/README.md index 351e8ee57..2cdbf8e34 100644 --- a/tag/stack/README.md +++ b/tag/stack/README.md @@ -9,6 +9,9 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | +| 1209 | [删除字符串中的所有相邻重复项 II](https://github.com/openset/leetcode/tree/master/problems/remove-all-adjacent-duplicates-in-string-ii) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] | Medium | +| 1190 | [反转每对括号间的子串](https://github.com/openset/leetcode/tree/master/problems/reverse-substrings-between-each-pair-of-parentheses) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] | Medium | +| 1130 | [叶值的最小代价生成树](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-tree-from-leaf-values) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1124 | [表现良好的最长时间段](https://github.com/openset/leetcode/tree/master/problems/longest-well-performing-interval) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] | Medium | | 1063 | [有效子数组的数目](https://github.com/openset/leetcode/tree/master/problems/number-of-valid-subarrays) 🔒 | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] | Hard | | 1047 | [删除字符串中的所有相邻重复项](https://github.com/openset/leetcode/tree/master/problems/remove-all-adjacent-duplicates-in-string) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] | Easy | diff --git a/tag/string/README.md b/tag/string/README.md index 913f6ee80..f4c24ab70 100644 --- a/tag/string/README.md +++ b/tag/string/README.md @@ -9,15 +9,19 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5099 | [验证回文字符串 III](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome-iii) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1216 | [验证回文字符串 III](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome-iii) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Hard | +| 1189 | [“气球” 的最大数量](https://github.com/openset/leetcode/tree/master/problems/maximum-number-of-balloons) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1181 | [前后拼接](https://github.com/openset/leetcode/tree/master/problems/before-and-after-puzzle) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1180 | [统计只含单一字母的子串](https://github.com/openset/leetcode/tree/master/problems/count-substrings-with-only-one-distinct-letter) 🔒 | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1177 | [构建回文串检测](https://github.com/openset/leetcode/tree/master/problems/can-make-palindrome-from-substring) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1170 | [比较字符串最小字母出现频次](https://github.com/openset/leetcode/tree/master/problems/compare-strings-by-frequency-of-the-smallest-character) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | -| 1169 | [查询无效交易](https://github.com/openset/leetcode/tree/master/problems/invalid-transactions) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | +| 1169 | [查询无效交易](https://github.com/openset/leetcode/tree/master/problems/invalid-transactions) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1165 | [单行键盘](https://github.com/openset/leetcode/tree/master/problems/single-row-keyboard) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1163 | [按字典序排在最后的子串](https://github.com/openset/leetcode/tree/master/problems/last-substring-in-lexicographical-order) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | +| 1156 | [单字符重复子串的最大长度](https://github.com/openset/leetcode/tree/master/problems/swap-for-longest-repeated-character-substring) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | +| 1138 | [字母板上的路径](https://github.com/openset/leetcode/tree/master/problems/alphabet-board-path) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 1119 | [删去字符串中的元音](https://github.com/openset/leetcode/tree/master/problems/remove-vowels-from-a-string) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | +| 1108 | [IP 地址无效化](https://github.com/openset/leetcode/tree/master/problems/defanging-an-ip-address) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 1106 | [解析布尔表达式](https://github.com/openset/leetcode/tree/master/problems/parsing-a-boolean-expression) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | | 1100 | [长度为 K 的无重复字符子串](https://github.com/openset/leetcode/tree/master/problems/find-k-length-substrings-with-no-repeated-characters) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 1096 | [花括号展开 II](https://github.com/openset/leetcode/tree/master/problems/brace-expansion-ii) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | @@ -69,7 +73,7 @@ | 657 | [机器人能否返回原点](https://github.com/openset/leetcode/tree/master/problems/robot-return-to-origin) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 647 | [回文子串](https://github.com/openset/leetcode/tree/master/problems/palindromic-substrings) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 635 | [设计日志存储系统](https://github.com/openset/leetcode/tree/master/problems/design-log-storage-system) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | -| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | +| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | | 616 | [给字符串添加加粗标签](https://github.com/openset/leetcode/tree/master/problems/add-bold-tag-in-string) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 609 | [在系统中查找重复文件](https://github.com/openset/leetcode/tree/master/problems/find-duplicate-file-in-system) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 606 | [根据二叉树创建字符串](https://github.com/openset/leetcode/tree/master/problems/construct-string-from-binary-tree) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | diff --git a/tag/tree/README.md b/tag/tree/README.md index 700140fb2..41094de26 100644 --- a/tag/tree/README.md +++ b/tag/tree/README.md @@ -10,8 +10,10 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | | 1145 | [二叉树着色游戏](https://github.com/openset/leetcode/tree/master/problems/binary-tree-coloring-game) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | +| 1130 | [叶值的最小代价生成树](https://github.com/openset/leetcode/tree/master/problems/minimum-cost-tree-from-leaf-values) | [[栈](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Medium | | 1123 | [最深叶节点的最近公共祖先](https://github.com/openset/leetcode/tree/master/problems/lowest-common-ancestor-of-deepest-leaves) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | | 1120 | [子树的最大平均值](https://github.com/openset/leetcode/tree/master/problems/maximum-average-subtree) 🔒 | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] | Medium | +| 1110 | [删点成林](https://github.com/openset/leetcode/tree/master/problems/delete-nodes-and-return-forest) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | | 1104 | [二叉树寻路](https://github.com/openset/leetcode/tree/master/problems/path-in-zigzag-labelled-binary-tree) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | | 1028 | [从先序遍历还原二叉树](https://github.com/openset/leetcode/tree/master/problems/recover-a-tree-from-preorder-traversal) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Hard | | 1026 | [节点与其祖先之间的最大差值](https://github.com/openset/leetcode/tree/master/problems/maximum-difference-between-node-and-ancestor) | [[树](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[深度优先搜索](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] | Medium | diff --git a/tag/two-pointers/README.md b/tag/two-pointers/README.md index b42d4fbcf..60818f1a5 100644 --- a/tag/two-pointers/README.md +++ b/tag/two-pointers/README.md @@ -9,7 +9,7 @@ | # | 题名 | 标签 | 难度 | | :-: | - | - | :-: | -| 5079 | [三个有序数组的交集](https://github.com/openset/leetcode/tree/master/problems/intersection-of-three-sorted-arrays) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | +| 1213 | [三个有序数组的交集](https://github.com/openset/leetcode/tree/master/problems/intersection-of-three-sorted-arrays) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | | 1093 | [大样本统计](https://github.com/openset/leetcode/tree/master/problems/statistics-from-a-large-sample) | [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | | 1004 | [最大连续1的个数 III](https://github.com/openset/leetcode/tree/master/problems/max-consecutive-ones-iii) | [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 992 | [K 个不同整数的子数组](https://github.com/openset/leetcode/tree/master/problems/subarrays-with-k-different-integers) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | @@ -28,7 +28,7 @@ | 763 | [划分字母区间](https://github.com/openset/leetcode/tree/master/problems/partition-labels) | [[贪心算法](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | | 723 | [粉碎糖果](https://github.com/openset/leetcode/tree/master/problems/candy-crush) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | | 713 | [乘积小于K的子数组](https://github.com/openset/leetcode/tree/master/problems/subarray-product-less-than-k) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | -| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | +| 632 | [最小区间](https://github.com/openset/leetcode/tree/master/problems/smallest-range-covering-elements-from-k-lists) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | | 567 | [字符串的排列](https://github.com/openset/leetcode/tree/master/problems/permutation-in-string) | [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 532 | [数组中的K-diff数对](https://github.com/openset/leetcode/tree/master/problems/k-diff-pairs-in-an-array) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | | 524 | [通过删除字母匹配到字典里最长单词](https://github.com/openset/leetcode/tree/master/problems/longest-word-in-dictionary-through-deleting) | [[排序](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium |